note 11856 added to ref.array.php
| From: | jeroen at a-eskwadraat dot nl | Date: | Fri, 09 Mar 2001 22:37:37 +0000 |
| Subject: | note 11856 added to ref.array.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-12134@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/en/ref.array.php