|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1999-12-05 06:41 UTC] carmelo at melting-soft dot com
the following script should drop a parser error :
(works on php3 and not on pp4)
$showvar=1;
if (1) {
$thevar="{$showvar}";
};
the following script works :
(work on php4 and php3)
$showvar=1;
if (1) {
$thevar='{'.$showvar.'}';
};
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 18 05:00:01 2026 UTC |
Curly braces have a new meaning in PHP 4.0, they allow you to reference a 'full featured' variable within quoted strings, e.g.: print "{$foo["bar"][2*3]}"; If you want to have the two letters {$ inside a quoted string, you must then escape either the { using \: print "\{$foo}";