On 6/28/05, Collin Davis <[EMAIL PROTECTED]> wrote:
> PHP can go hand in hand with Content Negotiation!

As a PHP developer first and a web designer second (sorry, I just
don't have design flare) let me say that PHP goes brilliantly for
XHTML.  If you use output buffering then you can indeed convert
between XHTML 1.0 Strict and HTML 4.01 Strict automagically using
str_replace('/>', '>', $output); in your output buffer callback.

I also use HTTP Accept: scanning to determine whether to send as
application/xhtml+xml or text/html.  I'm too lazy to run an output
buffer over most of my sites and do the naughty XHTML as text/html
thing then.  I figure if a browser doesn't see application/xhtml+xml
it's probably not going to notice that I'm going with something
recommended against ;)

The biggest difficulty you're likely to encounter is your <?xml
declaration - this can be confused for a php open tag if
short_open_tag is on.  Which it, in my opinion, should never be.  But
in case it is (as it is by default), turn it off in php.ini or with a
.htaccess directive:
php_flag short_open_tag Off

If you need any help with php, especially coding good php to make a
standards-conformant website, I'd recommend you look on IRC,
specifically irc.freenode.net channel ##php.


Michael Cordover
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help

Reply via email to