Re: [PHP] Quotes vs. Single Quote

[email protected] (Peter Lind)
Newsgroups php.general
Message-ID <[email protected]>
On 6 August 2010 04:10, Rick Dwyer <[email protected]> wrote:
> Hi List.
> I've mentioned before that I am both just beginning to learn PHP AND I have inherited a number of pages that I'm trying to clean up the w3c validation on.
>
> Something that confuses me is how the code on the page is written where in one instance, it follows this:
>
> echo "<table border='1'><tr>....
>
> And elsewhere on the page it follows:
>
> echo '<table border="1"><tr>....
>
> In what I've read and from many of the suggestions from this board, the latter seems to be the better way to code, generally speaking.
>

It isn't better or worse. The only thing that makes a difference is
what suits you - stick to what works for you. Both double-quotes and
single-quotes can result in gotchas (in double quotes you have to
escape more, which you have to keep in mind, whereas in single quotes
you have a lot less power, which you might forget). There's no
difference in performance, which leaves just one thing: personal
preference.

Regards
Peter

-- 
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
</hype>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.