Re: Miserable escape string problem
| From: | Dave Goodchild | Date: | Thu, 05 Oct 2006 23:26:19 +0000 |
| Subject: | Re: Miserable escape string problem | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-242738@lists.php.net to get a copy of this message | ||
Is this really worth all the keystrokes? Do we not have any more valuable
ways to spend our time?
On 06/10/06, intra_test@roibm.de <intra_test@roibm.de> wrote:
Richard Lynch wrote: $curly = '{'; echo "$curly$var1: $var2}"; Horrendous workaround. Google Kreme wrote: On 05 Oct 2006, at 11:37 , Chris Shiflett wrote:-- http://www.web-buddha.co.ukHeh. It was a rhetorical question. He said there was no way to escape the {'s Of course there is... that was my point. I suggest you bring yourself up to speed on what escaping really means. Your suggestion under no circumstances escaping. Actually, PHP Documentation does mention it: "Since you can't escape '{', this syntax...." See here(thanks go John Wells for posting about it): http://uk2.php.net/manual/en/language.types.string.php#language.types.string.parsing.complex Now you may go on a rampage about what escaping means, but honestly, I don't want to hear about it. Richard Lynch wrote: The whole thing with {} inside a string has always struck me as a total hack to fix something that wasn't broken in the first place, and I can never get it to do what I want. "Don't use it" is my solution. :-) Bingo. That is what I am trying to do. But I am not allowed since there is no escaping for this thing. Thanks all for the replies. My intention was to bring to light YA PHP design problem. Looks to me like I didn't really succeed, but at least it's out. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpGoogle Kreme wrote:So what is "{{$var1} : {$var2}}"Within a quoted string, you can surround variable names with braces for clarity. This is especially helpful for situations like this, where the rest of the string interferes with syntax.