In Chris Shiflett's new blog post today, he talks about the quoting of PHP strings and a few of the "gotchas" involved.
Therefore, within a string enclosed with single quotes, PHP needs to allow both single quotes and backslashes to be escaped. I'm not sure if this is explained very clearly in the manual.
PHP developers generally understand the difference between using single quotes versus double quotes to enclose a string. If you need stuff to be interpreted, you use double quotes. If you need to indicate a literal string, you use single quotes.
He gives examples of double-quoted strings with variables, double-quoted strings with slashes, single-quoted strings with slashes and a few more - giving the reasoning for why they output what they do. He's looking to alleviate some of the confusion that might not be helped by the strings section of the manual...




