note 11856 modified in ref.array.php by jmoore
| From: | jmoore@php.net | Date: | Sat, 10 Mar 2001 13:42:18 +0000 |
| Subject: | note 11856 modified in ref.array.php by jmoore | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-12161@lists.php.net to get a copy of this message | ||
Named indices for arrays:
$arr[bla] == $arr['bla'] == $arr["bla"]
notice the first syntax.
echo "The value of \$arr['bla'] is $arr['bla']"
won't work (very strange error by the way)
echo "The value of \$arr['bla'] is $arr[bla]"
WILL work on the other hand. Be warned.
(this is totally undocumented in the manual: the need/unneed for " and ' with
array-indices.)
http://www.php.net/manual/ref.array.php.php