note 15553 rejected and deleted from language.variables.variable by zak
| From: | zak@php.net | Date: | Mon, 17 Sep 2001 20:02:58 +0000 |
| Subject: | note 15553 rejected and deleted from language.variables.variable by zak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18089@lists.php.net to get a copy of this message | ||
What's with this?
$dynvar = "GLOBALS[cfg][DBName]";
echo $$dynvar;
there's no error but
nothing happens!
$dynvar = "GLOBALS";
$dynkey1 = "cfg";
$dynkey2 = "DBName";
echo ${$dynvar}[$dynkey1][$dynkey2];
works well but if you want to build dynamic variables in realworld you can
only use eval() but slower . I think it's not clear why working with arrays stored in variables
is so different to singlevariables stored in variables!
Is This a BUG????