Re: print "$array[$i][0]" pukes
| From: | Ernest E Vogelsinger | Date: | Thu, 06 Mar 2003 10:39:46 +0000 |
| Subject: | Re: print "$array[$i][0]" pukes | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138446@lists.php.net to get a copy of this message | ||
At 10:44 06.03.2003, David T-G said:
--------------------[snip]--------------------
>...and then Leif K-Brooks said...
>%
>% print "$i :: {$manilist[$i][0]}\n";
>Aha! Perfect. Here I'd been trying such things with the leading $ on
>the *outside* of the braces.
--------------------[snip]--------------------
Try to see it this way: $manilist[$i][0] is a PHP expression, thus needs to
be put in curly braces _as_a_whole_ within a string.
It doesn't hurt to use curly quotes even if they're not necessary - it's
just the same as with using brackets in expression to clarify operator
precedence: with brackets, you don't have to fear any performance impact
and gain the clarity of the evaluation sequence; with curly quotes, you
gain the correct result :-)
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/