I make a function for put in an array all php variable in a file (.php)
In the array, I want something like this:
$myvariable = 'hello man';
So I do:
$myarray['$variable'] = $variable;
For have:
array('$myvariable' => 'hello man', '$othervariable' => 'in the space...');
I want "print" the array like this:
foreach($myarray as $key =>$value){
echo $key.' -> '.$value.'<br>';
}
When I do:
$myarray['$variable'] = $variable;
$myarray["$variable"] = $variable; //don't work because "
$myarray[$variable] = $variable; //the key is change in value
don't stay as the variable name but as the value.
How to have the variable name as string??