note 53661 deleted from language.types.string by colder
| From: | colder@php.net | Date: | Tue, 17 Oct 2006 18:17:58 +0000 |
| Subject: | note 53661 deleted from language.types.string by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118644@lists.php.net to get a copy of this message | ||
Note Submitter: nutbar at innocent dot com
----
A correction to skippy's comment:
"...you can use either ${ or {$ to open the curly expression ie. "${var}" and
"{$var}" are equivalent."
Is incorrect.
For simple variables, such as in the example quoted yes both function and yeild the expected result.
However, when dealing with array variables like $array['key'], doing
"${array['key']}" will yeild errors or unexpected results. The correct
formatting is "{$array['key']}".