note 23454 added to language.variables.variable

From: Date: Thu, 18 Jul 2002 20:12:46 +0000
Subject: note 23454 added to language.variables.variable
Groups: php.notes 
Request: Send a blank email to php-notes+get-33269@lists.php.net to get a copy of this message
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 -- http://www.php.net/manual/en/language.variables.variable.php http://master.php.net/manage/user-notes.php?action=edit+23454 http://master.php.net/manage/user-notes.php?action=delete+23454 http://master.php.net/manage/user-notes.php?action=reject+23454

« previous php.notes (#33269) next »