Back to Basics - Why Use Single Quotes?



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
.



Relevant Pages

  • Re: nesting JS in echos
    ... html coder here, new and terrified * of php!! ... i'm trying to bury a JS script to rotate a photo, in a page i converted from html to php. ... thought I'd try integrating a tested and true JS image random rotator script into the echo command, but the problem was the syntax of the single quotes and double quotes needed in the doc.write and variable sequences in the JS. ...
    (comp.lang.php)
  • Re: nesting JS in echos
    ... html coder here, new and terrified * of php!! ... i'm trying to bury a JS script to rotate a photo, in a page i converted from html to php. ... thought I'd try integrating a tested and true JS image random rotator script into the echo command, but the problem was the syntax of the single quotes and double quotes needed in the doc.write and variable sequences in the JS. ...
    (comp.lang.php)
  • Re: PHP forms completely blank
    ... When I run the php script the resulting web page is blank. ... #check email useraddr field is not blank ... I use single quotes and it works fine on a Linux hosting service with Php5.0 ... nothing needs to be enabled to use the $_SERVER variables. ...
    (alt.php)
  • Re: nesting JS in echos
    ... html coder here, new and terrified * of php!! ... i'm trying to bury a JS script to rotate a photo, in a page i converted from html to php. ... thought I'd try integrating a tested and true JS image random rotator script into the echo command, but the problem was the syntax of the single quotes and double quotes needed in the doc.write and variable sequences in the JS. ...
    (comp.lang.php)
  • Re: PHP forms completely blank
    ... Jerry Stuckle wrote: ... When I run the php script the resulting web page is blank. ... #check email useraddr field is not blank ... I use single quotes and it works fine on a Linux hosting service with Php5.0 ...
    (alt.php)