note 3444 modified in Variable variables by jeroen

From: Date: Thu, 24 May 2001 00:15:23 +0000
Subject: note 3444 modified in Variable variables by jeroen
Groups: php.notes 
Request: Send a blank email to php-notes+get-14233@lists.php.net to get a copy of this message
When using variable variables that are arrays, and you wish to print the value, you have to use a temporary variable. For example: print("${$a}[$index]"); will not work, use $temp=${$a}[$index]"); print("$temp"); instead. [Editors note: See the variable parsing section in types/strings. You can use print "{${$a}[$index]}"; in this case http://www.php.net/manual/variable-variables.php

« previous php.notes (#14233) next »