Re: Miserable escape string problem

This is a discussion on Re: Miserable escape string problem within the PHP General forums, part of the PHP Programming Forums category; intra_test@roibm.de wrote: > Using this string: > "{$var1: $var2}" > ....of course it doesn't work ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-05-2006
Kae Verens
 
Posts: n/a
Default Re: Miserable escape string problem

intra_test@roibm.de wrote:
> Using this string:
> "{$var1: $var2}"
> ....of course it doesn't work as some might expect.
>
> But why in the name of [whatever, too many to list] doesn't this one
> below work?
> "\{$var1: $var2}"
>
> If \ is an escape character why does it also appear in the string output?
> Why does the above \ escape {$var1 and not only the {?
>
> Miserable.


because {$var1} is a valid syntactical construct?

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

Kae
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:00 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0