note 53661 added to language.types.string
| From: | nutbar at innocent dot com | Date: | Wed, 08 Jun 2005 16:10:26 +0000 |
| Subject: | note 53661 added to language.types.string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90124@lists.php.net to get a copy of this message | ||
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']}".
----
Manual Page -- http://www.php.net/manual/en/language.types.string.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53661
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53661&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53661&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53661&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53661&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53661&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53661&report=yes
Search -- http://master.php.net/manage/user-notes.php