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



On Wed, Jul 30, 2008 at 6:51 PM, Stephen <stephen-d@xxxxxxxxxx> wrote:
I have traditionally used double quotes going back to my PASCAL days.

I see many PHP examples using single quotes, and I began to adopt that
convention.

Even updating existing code.

And I broke some stuff that was doing variable expansion. So I am back to
using double quotes.

But I wonder, is there any reason to use single quotes?

Stephen

Because sometimes it is nice to do this:

$onclick = ' onclick="..."'

Not having to escape my single tick makes it more readable.
.



Relevant Pages

  • Re: [PHP] Back to Basics - Why Use Single Quotes?
    ... And I broke some stuff that was doing variable expansion. ... is there any reason to use single quotes? ... I often go for HEREDOC syntax if the backslashes start taking over - readability is much more important to me than nanoseconds of performance. ...
    (php.general)
  • Re: [PHP] Back to Basics - Why Use Single Quotes?
    ... I see many PHP examples using single quotes, and I began to adopt that ... And I broke some stuff that was doing variable expansion. ... is there any reason to use single quotes? ... Dedicated servers, VPS, and hosting from $2.50/mo. ...
    (php.general)
  • Re: [PHP] Back to Basics - Why Use Single Quotes?
    ... I see many PHP examples using single quotes, and I began to adopt that ... And I broke some stuff that was doing variable expansion. ... is there any reason to use single quotes? ... Dedicated servers, VPS, and hosting from $2.50/mo. ...
    (php.general)
  • Re: Updating a field in a record stored in a table
    ... ndunwoodie wrote: ... > I'm sorry to report that I did have a field name misspelled. ... > problem is that the code doesn't do any updating at all. ... inside double-quotes you have to use single quotes to avoid a conflict. ...
    (microsoft.public.access.modulesdaovba)
  • Back to Basics - Why Use Single Quotes?
    ... I see many PHP examples using single quotes, and I began to adopt that convention. ...
    (php.general)