Re: [PHP] Back to Basics - Why Use Single Quotes?



Single quotes do still recognise \' and \\ though, for getting a
single quote and backslash. IIRC (which isn't likely) they're the only
two.

--
Richard Heyes
http://www.phpguru.org
.



Relevant Pages

  • Re: Double backslashes \ in strings
    ... and the single backslash isn't ... The simplest way to specify a string is to enclose it in single quotes. ... echo ''; ...
    (comp.lang.php)
  • Re: weird backsplash behaviour inside single quotes
    ... > therefore it must escape itself as well. ... we will lose the reason for which single quotes were introduced in the ... as is but for the double backslash a quadruple backslash is required. ... followed by a single quote was special writing strings with a trailing ...
    (comp.lang.ruby)
  • Re: Unsolvable? How to extract dollar amount from $1.12 stored in a file
    ... single quotes or backslash to modify the string. ...
    (perl.beginners)
  • Re: FTP to a windows file share?
    ... You'll need to double the first backslashes, because a double backslash - being the escape character - evaluates to a single one even in single quotes. ... a closing backslash needs to be escaped at the end of a single quoted string because it would be interpreted as an escaped single quote otherwise, which results in an error complaining about an unterminated string. ...
    (comp.lang.perl.misc)
  • Re: Backslash-apostrophe POOF.
    ... The form is getting what PHP sees, i.e. a backslash before the ... I've coded the HTML form with single quotes around the ... The apostrophe ...
    (comp.lang.javascript)