Re: Can i take the variable name in a function?
| From: | Andy Hultgren | Date: | Wed, 11 Oct 2006 16:20:41 +0000 |
| Subject: | Re: Can i take the variable name in a function? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-242989@lists.php.net to get a copy of this message | ||
ummmm.... no... I suppose I should have though! :)
On 10/11/06, Jochem Maas <jochem@iamjochem.com> wrote:
Andy Hultgren wrote: Would something like this work? did you try it? ;-) it won't work Definition: function example($$ex) { echo "Variable Name is $ex"; } example($ball); I'm fairly new to php and not so familiar with variable variables, but I thought I'd throw it out there as a thought! Andy On 10/11/06, *Jochem Maas* <jochem@iamjochem.com <mailto:jochem@iamjochem.com>> wrote:Jônata Tyska Carvalho wrote:How can i take the variable name inside a function, ex: definition: function example( $ex ){ echo "Variable Name is $ex "; // how to do this? } use: example($ball); output: Variable Name is ball; another: example($sportCar); output: Variable Name is sportCar; is that possible?no.-- PHP General Mailing List ( http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php