Re: [PHP] strange string evaluation
- From: robert@xxxxxxxxxxxxx (Robert Cummings)
- Date: Thu, 31 Jul 2008 11:58:03 -0400
On Thu, 2008-07-31 at 17:54 +0200, Marten Lehmann wrote:
Hello,
with PHP 5.0.x this two lines of code returned "{TEST}":
$var = "TEST";
print "\{$var}";
But with PHP 5.2.x, the same code returns "\{TEST}"
If I remove the backslash:
$var = "TEST";
print "{$var}";
then just "TEST" is return (without any brackets).
What is the recommended way for PHP 5.2.x to work with that? It looks a
bid odd if I have to write
print "{". $var. "}";
Yeah, that is weird. I'd write:
echo '{'.$var.'}';
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
.
- References:
- strange string evaluation
- From: Marten Lehmann
- strange string evaluation
- Prev by Date: strange string evaluation
- Next by Date: Re: [PHP] Get Remote-Image
- Previous by thread: strange string evaluation
- Next by thread: Re: [PHP] strange string evaluation
- Index(es):