note 10231 modified in Variable variables by jeroen
| From: | jeroen@php.net | Date: | Thu, 24 May 2001 00:21:46 +0000 |
| Subject: | note 10231 modified in Variable variables by jeroen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-14236@lists.php.net to get a copy of this message | ||
[Ed: eval() is easier]
It is possible to create an array using variable variables (but difficult)
take a look at this :
$ss='test[hello]';
if(ereg("([^[]*)\[([^]]*)",$ss,$out)) ${$out[1]}[$out[2]]= "hello world";
echo "view --->" . $test[hello]; #display hello world
pffffuiiiii.
http://www.php.net/manual/variable-variables.php