Discussion: variable
Afficher un message
Vieux 16/09/2007, 21h46   #8
Sanders Kaufman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: variable

Michael Fesser wrote:

> A variable variable is something like that:
>
> $foo = 'bar';
> $bar = 42;
>
> print ${$foo}; // prints 42
>
> This means the name of the variable is taken from another (string)
> variable. The same can be done with superglobals, but not if you're
> inside a function or method:
>
> function test() {
> $foo = '_GET';
> var_dump(${$foo}); // throws a notice
> }


I think that what's confusing me is that double-dollar thing.
I've seen it before, but thought it was a typo.

Could you tell me what it means, or where to look in the docs to find
out about it.
  Réponse avec citation
 
Page generated in 0,04484 seconds with 9 queries