Re: Can i take the variable name in a function?
| From: | Jônata Tyska Carvalho | Date: | Wed, 11 Oct 2006 22:02:22 +0000 |
| Subject: | Re: Can i take the variable name in a function? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-243007@lists.php.net to get a copy of this message | ||
i know what i want to do, and im not a rookie in php.
example of a use:
debug($vetNames);
output:
The variable vetNames has the follow properties:
key1 => value1,
key2 => value2
....
....
just one example. need it for another things.
On 10/11/06, Richard Lynch <ceo@l-i-e.com> wrote:
On Wed, October 11, 2006 2:21 pm, Richard Lynch wrote: If you really really really know what you are doing, you can do this: And if you make no typos like I just did... :-) function example($name){ // > global $name; //Whoops! global $$name; //note the TWO $ symbols! echo "The variable $name has the value: ", $$name; } -- 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?-- Jônata Tyska Carvalho ----------------------------------------------------------------- -- Técnico em Informática pelo Colégio Técnico Industrial (CTI) -- Graduando em Engenharia de Computação Fundação Universidade Federal de Rio Grande (FURG)