Using $$
| From: | Arno Kuhl | Date: | Thu, 19 Nov 2009 12:23:03 +0000 |
| Subject: | Using $$ | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-299928@lists.php.net to get a copy of this message | ||
I was looking at some old code that I'm convinced once worked but now using
php5 it doesn't seem to work anymore.
$input = "_REQUEST";
if (is_array($$input)) {
// do something
}
I know $_REQUEST is an array, but $$input is NULL (I was expecting it ==
$_REQUEST).
I also tried ${$input} but same result.
I tested something other than a superglobal and it works as expected. What
am I missing?
Cheers
Arno