| px | top | add code | search | signup | login | help |
<?
function arr2vars($arr, $pref="", $suff=""){
while (list($xkey, $val) = each($arr)){
//global ${$pref.$xkey.$suff};
eval("global \$$pref$xkey$suff;");
${$pref.$xkey.$suff} = $val;
}
}
/* use:
$arr = Array("ahoj"=>"lidi", "jakse"=>"mate");
arr2vars($arr);
echo $ahoj;
*/
?>
Comments or questions?
PX is running PHP 5.2.11
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.