Re: Bug(?) in quotes and \ escaping
| From: | Rouvas Stathis | Date: | Sun, 10 Dec 2000 21:20:53 +0000 |
| Subject: | Re: Bug(?) in quotes and \ escaping | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29588@lists.php.net to get a copy of this message | ||
OOPS! Thanks for the RTFM.
-Stathis.
Matthew Ballard wrote:
>
> Quote from:
> http://www.php.net/manual/language.types.string.php
> The second way to delimit a string uses the single-quote ("'") character.
> When a string is enclosed in single quotes, the only escapes that will be
> understood are "\\" and "\'". This is for convenience, so that you can
> have
> single-quotes and backslashes in a single-quoted string. Variables will
> not be expanded inside a single-quoted string.
> Matthew
>
> At 08:48 PM 12/9/2000 +0200, you wrote:
> >Is this a bug?
> >
> >$l = '\'; <--- syntax error,
> > in the next line as the string is not terminated(!)
> >$l = '\\' <--- correct, $l is assigned the value of a single \
> >
> >I thought that only double-quotes (") interpret what's inside them.
> >The goal here is to assign $l a single baskslash char.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net