Via an entry on John Cox's weblog today, he points to an article from Neil Crosby concerning the serving of XHTML in PHP with the correct mime type.
The aim of this article is to show you how to use PHP to control the mime type given to your users' web browsers for your XHTML pages. There are other ways to perform the same task, with httpd.conf or .htaccess files, but this is the way which I control mime types on this website.
A lot of websites nowadays make sure that they validate to XHTML 1.0 or 1.1 standards. At least, they think they do. The sad fact is, that unless the correct mime type is being used, no browser will actually process your carefully put together XHTML as XHTML. Instead, it's treated as tag soup, just as if you'd used any other doc type to identify your page.
He talks about the three different requirements that must be followed for XHTML compliance, and how to use PHP to echo the correct headers/write the correct tags to make it all work...




