|
Posted by Dawsons on 10/17/90 11:40
Thank you very much, this is excellent!
"Ewoud Dronkert" <firstname@lastname.net.invalid> wrote in message
news:dd6kv19jkbetderhetu39ioqkvq6nuta4n@4ax.com...
> Dawsons wrote:
>> Is it possible to echoe thew ACTUAL variable name into a document
>
> function getvarname(&$var)
> {
> $ret = '';
> $tmp = $var;
> $var = md5(uniqid(rand(), TRUE));
>
> $key = array_keys($GLOBALS);
> foreach ( $key as $k )
> if ( $GLOBALS[$k] === $var )
> {
> $ret = $k;
> break;
> }
>
> $var = $tmp;
> return $ret;
> }
>
> $another = 'test';
> $testvar = 'test';
> echo getvarname($testvar); //echoes 'testvar'
>
> --
> E. Dronkert
Navigation:
[Reply to this message]
|