Re: Single Quotes vs Double Quotes

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-11-2003
Dave Dash
 
Posts: n/a
Default Re: Single Quotes vs Double Quotes

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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:45 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0