[KLUG Members] php and quotation marks

bill bill at billtron.com
Tue Sep 27 13:29:22 EDT 2005


On Tue, 2005-09-27 at 10:59, Adam Tauno Williams wrote:

> Right use single outer quotes, always.

Just my experience here:  I used to do that and it was a problem.  

Assume we're talking about displaying HTML.  If I start with single
outer quotes (') I often have to change the code later to contain a
variable.  If I started with single quotes it wouldn't display the value
of the variable.  Bummer.  I'd have to go back and change them to double
quotes, and then also change any other quotes they affected.  AAAARGH.  

So, I always start and end with double quotes (") and escape any other
double quotes inside there.  I hardly ever use single quotes unless I
really need them.

kind regards,

bill



More information about the Members mailing list