note 91344 added to language.types.string

From: Date: Sun, 07 Jun 2009 06:13:32 +0000
Subject: note 91344 added to language.types.string
Groups: php.notes 
Request: Send a blank email to php-notes+get-156426@lists.php.net to get a copy of this message
@strata_ranger: True, you can't escape the {}s (on 5.2.9 I get "\{" in the output, so the braces do remain) but you can double them up. <?php $var = "value"; echo "var = {{$var}}"; // var = {value} ?> Since {{ is invalid syntax (have to have a $ immediately after the brace) PHP skips the first one and proceeds to the second. Thus the { gets printed and the {$var} gets parsed. ---- Server IP: 208.69.120.35 Probable Submitter: 75.172.107.188 ---- Manual Page -- http://www.php.net/manual/en/language.types.string.php Edit -- https://master.php.net/note/edit/91344 Del: integrated -- https://master.php.net/note/delete/91344/integrated Del: useless -- https://master.php.net/note/delete/91344/useless Del: bad code -- https://master.php.net/note/delete/91344/bad+code Del: spam -- https://master.php.net/note/delete/91344/spam Del: non-english -- https://master.php.net/note/delete/91344/non-english Del: in docs -- https://master.php.net/note/delete/91344/in+docs Del: other reasons-- https://master.php.net/note/delete/91344 Reject -- https://master.php.net/note/reject/91344 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#156426) next »