note 42171 added to function.get-defined-vars

From: Date: Thu, 06 May 2004 09:32:04 +0000
Subject: note 42171 added to function.get-defined-vars
Groups: php.notes 
Request: Send a blank email to php-notes+get-69271@lists.php.net to get a copy of this message
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) ---- Manual Page -- http://www.php.net/manual/en/function.get-defined-vars.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42171 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42171&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42171&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#69271) next »