note 46730 deleted from function.list by googleguy
| From: | googleguy@php.net | Date: | Thu, 13 Sep 2012 10:08:20 +0000 |
| Subject: | note 46730 deleted from function.list by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190710@lists.php.net to get a copy of this message | ||
Note Submitter: jennevdmeer at zonnet dot nl
----
This is a function simulair to that of 'list' it lists an array with the 'key'
as variable name and then those variables contain the value of the key in the array.
This is a bit easier then list in my opinion since you dont have to list up all variable names and
it just names them as the key.
<?php
function lista($a) {
foreach ($a as $k => $v) {
$s = "global \$".$k;
eval($s.";");
$s = "\$".$k ." = \"". $v."\"";
eval($s.";");
}
}
?>