Re: Can i take the variable name in a function?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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)

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux