Re: quotes on attributes (was Re: Unwanted space and quoting attributes)

by TjL <luomat(at)operamail.com>

 Date:  Tue, 04 Mar 2003 17:46:19 -0500
 To:  Liz Bartlett <khyri(at)idyllmtn.com>,
hwg-critique(at)hwg.org
 References:  adelphia idyllmtn
  todo: View Thread, Original
On Tue, 04 Mar 2003 14:29:39 -0800, Liz Bartlett <khyri(at)idyllmtn.com> 
wrote:

> I agree - because there are cases where attributes must be quoted,
> and XHTML requires it, I always quote them.
>
> It requires a little extra work to escape the quotes in your
> PHP source code, but it's worth it for the standards compliance.
> After a while, you get used to typing:
>
> print ("<a href=\"" . $url . "\">This link</a>");
>
> If your class was a few summers ago, it might have been before this
> became as significant as it is today.

I know this isn't a PHP list, but you can make this a tiny bit easier and 
more efficient by using single quotes instead of double.

	print ('<a href="' . $url . '">This link</a>');

When PHP sees double quotes as part of its commands, it looks for 
variables.  As long as there are no variables, you can gain a (miniscule) 
bit of processing, but more importantly you don't have to escape your "

FYI/HTH

TjL

HTML: hwg-critique mailing list archives, maintained by Webmaster @ IWA