DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Serving XHTML With PHP
How to correctly serve XHTML with PHP:
header('Vary: Accept');
if (stristr($_SERVER[HTTP_ACCEPT], 'application/xhtml+xml'))
{
header('Content-Type: application/xhtml+xml; charset=utf-8');
}
else
{
header('Content-Type: text/html; charset=utf-8');
}





