note 54352 deleted from language.types.string by jacques
| From: | jacques@php.net | Date: | Fri, 01 Jul 2005 07:37:40 +0000 |
| Subject: | note 54352 deleted from language.types.string by jacques | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-91242@lists.php.net to get a copy of this message | ||
Note Submitter: slackaz at gmail dot com
----
The above example in the "Complex (curly) syntax" section contains the following error:
--------------------------------------------------------------
echo "This is the value of the var named $name: {${$name}}";
--------------------------------------------------------------
There are two mistakes in this code:
1. Because the first instance of $name is in double-quotes, the actual variable will be printed out
(ex., "This is the value of the var named Bob:").
2. The second $ inside the curly brackets must be removed.
The corrected example is:
--------------------------------------------------------------
echo "This is the value of the var named \$name: {${name}}";
--------------------------------------------------------------