RE: [PHP] Variable variables question?
| From: | Ford, Mike [LSS] | Date: | Fri, 13 Jun 2003 19:26:10 +0000 |
| Subject: | RE: [PHP] Variable variables question? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151414@lists.php.net to get a copy of this message | ||
-----Original Message-----
From: Douglas Douglas
To: php-general@lists.php.net
To get the superglobal array ($_GET or $_POST), I try
to build these strings '_'.$method. I'm sure this part
works, PHP builds the string _GET or _POST according
to the $method parameter.
I use ${'_'.$method} to get the contents of the
superglobal. But this piece of code doesn't work.
--------------------------
Well, it won't, because there's a prominent warning on the manual page
(http://www.php.net/language.variables.variable) that says:
"Please note that variable variables cannot be used with PHP's
Superglobal arrays. This means you cannot do things like ${$_GET}."
Cheers!