Serving XHTML With PHP
Join the DZone community and get the full member experience.
Join For FreeHow 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');
}
PHP
XHTML
Opinions expressed by DZone contributors are their own.
Comments