NYCPHP Meetup

NYPHP.org

[nycphp-talk] Stupid Question - difference between using single and double quotes

Christopher R. Merlo cmerlo at ncc.edu
Mon Mar 29 10:06:52 EST 2004


On 2004-03-29 10:04 -0500, Scott Mattocks <crisscott at netzero.com> wrote:

> $stuff = 'things';
> echo "I like $stuff"; // output: I like things
> echo 'I like $stuff'; // output: I like $stuff
> 
> In general you should use double quotes when you want part of a string 
> to be parsed and executed.  You should use single quotes otherwise.

It should be noted also that using the single quotes where appropriate
is more efficient; it lets the parser know that there's nothing to
evaluate.
-c

-- 
  cmerlo at ncc.edu             http://turing.matcmp.ncc.edu/~cmerlo

There is not now, and never will be, a language in which it is the
least bit difficult to write bad programs.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20040329/3ec4de85/attachment.sig>


More information about the talk mailing list