note 76332 added to language.types.array
| From: | moehbass at gmail dot com | Date: | Wed, 11 Jul 2007 00:41:39 +0000 |
| Subject: | note 76332 added to language.types.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128370@lists.php.net to get a copy of this message | ||
<b>Mark Gukov</b> wrote below:
Regarding the fact that there's no need to quote arrays keys when enclosed in double quotes: it
only applies to single dimensional arrays.
The following works fine:
<?php
$r['a'] = 'apple';
echo "$r[a] is tasty.";
?>
...but in the case of multi-dimensional arrays:
<?php
$r['a']['b'] = 'banana';
echo "$r[a][b] is tasty.";
?>
would result in "Array[c] is tasty."
-----------------------------------------------------------------
However, the following runs fine;
$r['a']['b'] = 'banana';
echo "{$r[a][b]} is tasty.";
Just box it!
----
Server IP: 64.71.164.2
Probable Submitter: 196.205.206.106
----
Manual Page -- http://www.php.net/manual/en/language.types.array.php
Edit -- https://master.php.net/note/edit/76332
Del: integrated -- https://master.php.net/note/delete/76332/integrated
Del: useless -- https://master.php.net/note/delete/76332/useless
Del: bad code -- https://master.php.net/note/delete/76332/bad+code
Del: spam -- https://master.php.net/note/delete/76332/spam
Del: non-english -- https://master.php.net/note/delete/76332/non-english
Del: in docs -- https://master.php.net/note/delete/76332/in+docs
Del: other reasons-- https://master.php.net/note/delete/76332
Reject -- https://master.php.net/note/reject/76332
Search -- https://master.php.net/manage/user-notes.php