note 51012 added to language.variables.variable

From: Date: Wed, 16 Mar 2005 14:01:02 +0000
Subject: note 51012 added to language.variables.variable
Groups: php.notes 
Request: Send a blank email to php-notes+get-86545@lists.php.net to get a copy of this message
As already mentioned by John, there seems to be a problem when using array braces inside the variable name. $var_name_a = 'my_array[1]'; $var_name_b = 'my_array[2]'; $$var_name_a = 'foo'; $$var_name_b = 'bar'; var_dump($my_array); // Output: NULL Any suggestions for a work-around? I would like to generate a tree structure using variable variables. ---- Manual Page -- http://www.php.net/manual/en/language.variables.variable.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51012 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51012&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51012&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51012&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51012&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51012&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51012&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86545) next »