The extraction guide shows that you can extract an array, for example:
extract(array('one'=>1,'two'=>2));
in $ one, $ two ...
But the extract function does not return variables. Is there a way to โglobalizeโ these variables? Maybe not using extract, but a foreach loop?
EDIT: (explanation of what I'm trying to achieve) I have an array containing hundreds of output messages that I want to have available as variables efficiently. I mean, whenever I want to display a message, say:
$englishMessages = array('helloWorld'=>'Hello World');
$spanishMessages = array('helloWorld'=>'Hola Mundo');
'<span id="some">'. $helloWorld .'</span>';
A message will appear. The reason I do this is because users can change the language in which they view the website, so something like: ''. $ helloWorld. ''; will produce:
Hola Mundo!