Re: Variable Variables and Superglobals
| From: | Sara Golemon | Date: | Thu, 05 Aug 2004 16:05:01 +0000 |
| Subject: | Re: Variable Variables and Superglobals | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-11954@lists.php.net to get a copy of this message | ||
> function foo($arg){
> $lvar="_ENV";
>
> echo $_ENV["OS"]; // --> Windows NT
> echo ${$arg}["OS"]; // --> *nothing*
> echo ${$lvar}["OS"]; // --> *nothing*
> var_dump( $$arg ); // --> NULL
> var_dump( $$lvar); // --> NULL
> }
> // END //////////////////////////////////////////////////////////////
>
echo $GLOBALS[$lvar]['OS'];