Posted by Sanders Kaufman on 09/16/07 20:46
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.
[Back to original message]
|