This works, but it is not retrieved into the context that it was calling, just global ...
function my_function($array){
foreach($array as $key => $value) {
global $$key;
$$key = $value;
}
}
CodePad .
However, I would not recommend it. It is rarely (but not exclusively never) a good idea to unpack a bunch of things into a global area.
, , , , , .