note 44281 added to language.types.string
| From: | skippyzuavranet at rn2 dot php dot net | Date: | Tue, 20 Jul 2004 12:55:28 +0000 |
| Subject: | note 44281 added to language.types.string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-73687@lists.php.net to get a copy of this message | ||
The short version for the curly syntax:
1. $str{something} is the equivalent of $str[something]
2. Inside "" strings you can use any variable, no matter how complex the addressing mode
(multiple index array, imbricated objects) by enclosing the variable in {}:
"foo{$any_variable}bar".
To add to the confusion:
a) The two uses above have nothing in common, conceptually. For instance, #1 can use operations or
functions as that something, #2 is restricted to just variables.
b) In #2, you can use either ${ or {$ to open the curly expression ie. "${var}" and
"{$var}" are equivalent.
----
Manual Page -- http://www.php.net/manual/en/language.types.string.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44281
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44281&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44281&report=yes
Search -- http://master.php.net/manage/user-notes.php