Can it be done?
function my_function(&$array){
// processing $array here
extract($array); // create variables but not here
}
function B(){
$some_array = array('var1' => 23423, 'var2' => 'foo');
my_function($some_array);
// here I want to have $var, $var2 (what extract produced in my function)
}
For example parse_str() is able to do this.
Edit Wasn’t thinking in my first answer.
The answer is no; you can move the
extractcall inside your functionB, that’s about it.Btw, with some more background of your problem I could improve my answer 🙂