This is a discussion on Re: Single Quotes vs Double Quotes within the PHP General forums, part of the PHP Programming Forums category; With all that's been said in mind ('$var' unparsed "$var" parsed). The rule of thumb I follow ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
With all that's been said in mind ('$var' unparsed "$var" parsed).
The rule of thumb I follow is, if it needs to be parsed (has a $variable or \n \r \t etc) then used double quotes, otherwise use single quotes... it conserves processing. -dd "Micro Brew" <microbrewclub@yahoo.com> wrote in message news:20030909040334.44065.qmail@web10306.mail.yaho o.com... > Hi everyone, > > Could somebody please explain to me the difference > between single quotes and double quotes in PHP. It > seems like they can be used interchangeably a lot in > PHP but not always. For example: > > This works: > header('Location: http://somedomain.com') > > This does not work: > header('Location: $url') > > This works: > header("Location: $url") > > > Why??? Sorry if this has been asked before, but I > didn't find a suitable answer in the archives. TIA. > > Mike > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com |