Re: name of the variable

From: Date: Mon, 12 Mar 2007 23:58:45 +0000
Subject: Re: name of the variable
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-250357@lists.php.net to get a copy of this message
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 several functions, getting a different name each time. You probably should be putting 'foo' and 'abc' into an array instead. $foobar['foo'] = 'abc'; You can then address 'foo' and 'abc' with various array functions. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#250357) next »