note 23454 deleted from language.variables.variable by danbrown
| From: | danbrown@php.net | Date: | Wed, 24 Jun 2009 17:01:13 +0000 |
| Subject: | note 23454 deleted from language.variables.variable by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-157418@lists.php.net to get a copy of this message | ||
Note Submitter: John
----
A string that looks like an array can be used as a variable variable, but it won't equal the
array value. Very odd. It defies the naming rules.
$one[1] = 'John';
$two = 'one[1]';
echo "one={$one[1]} two={$$two}<br>"; // => one=John two=
$$two = "Doe";
echo "one={$one[1]} two={$$two}<br>"; // => one=John two=Doe