Topic: Pulling an array from file
Yet another of my wayward questions. Is there a simple way to, (for example with the langfiles), create a master array, along the lines of:
$lang = array(
'common' => $lang_dir.'common.php',
'delete' => $lang_dir.'delete.php',
'userlist' => $lang_dir.'userlist.php',
);
foreach ($lang as $key => $langfile)
{
[Create the above array from the contents of this $langfile];
}
so that they could be referenced as:
$lang['common']['index']
rather than:
$lang_common['index']
?
Would it be a case of removing the array command from those files and reading them in to achieve it, or is there another, more straight forward method? Also, would the above actually work okay?
Cheers,
Matt