note 42171 deleted from function.get-defined-vars by danbrown
| From: | danbrown@php.net | Date: | Fri, 06 Feb 2009 00:53:18 +0000 |
| Subject: | note 42171 deleted from function.get-defined-vars by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-150282@lists.php.net to get a copy of this message | ||
Note Submitter: Ruben Barkow(mail-> at web dot de)
----
this does NOT work:
i tried to find out the name of a variable, that was sent to myfunction($in) with this code:
myfunction($in) {
$e=array_reverse(get_defined_vars());
echo "possible name for the variable in the function call: '";
foreach ($e as $n=>$v){
if ($v===$in) {
echo $n;
break;
}
}
echo"'";
}
but:
get_defined_vars() doesent give back the variables outside of a function.
(the code does work in the main programcode)