Code
<?php
header("Vary: Accept");
if (stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') || stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator"))
{
header('Content-type: application/xhtml+xml');
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
}
else
{
header('Content-type: text/html');
}
?>
header("Vary: Accept");
if (stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') || stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator"))
{
header('Content-type: application/xhtml+xml');
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
}
else
{
header('Content-type: text/html');
}
?>
