Re: Miserable escape string problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well Kae, if you reply 3 times let me also reply you once.
What you try to suggest is a workaround. A workaround should
not be needed for such a basic thing. Ever.

The point is, \ should escape only the {, just like
it does when you escape a variable like this "\$var1"
In this case, \ only escapes the $.

Even then, why does it output the \?
Try this:
=========================================================
$var1 = 1;
$var2 = 2;
print("\{$var1: $var2}");

=========================================================
It will output: \{1: 2}
Why the \? Isn't it an escape character.


If you try to get me thinking that this is normal behaviour,
let's agree to disagree.

PS: I'd like to see an insider comment on this, eventually
explain the thought behind this implementation.



Kae Verens wrote:
because {$var1} is a valid syntactical construct?

try this instead:
 '{'.$var1.': '.$var2.'}'

Kae

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux