On Fri, March 9, 2007 4:27 am, Cefull Lo wrote:
> Hi everyone,
> Is there any function that return the name of the variable??
> i.e.
>
> $foo='abc';
> $bar=somefunc($foo); // $bar='foo' here
No.
And there cannot be, as any given variable could have multiple
references and be passed around through
There's also another function on the official PHP site.
http://no.php.net/manual/en/language.variables.php#49997
2007/3/9, Cefull Lo <[EMAIL PROTECTED]>:
Hi everyone,
Is there any function that return the name of the variable??
i.e.
$foo='abc';
$bar=somefunc($foo); // $bar='foo' here
Thanks
I found this on the zend forums. Hope it helps.
function Dump($var) {
if (key_exists($var, $GLOBALS)) {
echo "$$var:\n";
var_dump($GLOBALS[$var]);
echo "\n\n";
}
else
echo "No variables named
$$var!\n";
}
-
Cefull Lo wrote:
> Hi everyone,
> Is there any function that return the name of the variable??
> i.e.
>
> $foo='abc';
> $bar=somefunc($foo); // $bar='foo' here
no - and if you think you need this then there is something very wrong with you
code,
it's completely backward-assed and you need to ret
Hi everyone,
Is there any function that return the name of the variable??
i.e.
$foo='abc';
$bar=somefunc($foo); // $bar='foo' here
Thanks
--
-BEGIN GEEK CODE BLOCK-
Version: 3.1
GSC d- s:>++ a- C++ UL/B+++$ !P L++>+
E--- W+ N o-- K? w++ O? M- V- PS PE++(-) Y+
PGP++@ t 5 X R+>+++$ t
5 matches
Mail list logo