$xhtml = (preg_match('|\bapplication/xhtml\+xml\b|', $_SERVER['HTTP_ACCEPT']) ? true : false); header('Content-Type: ' . ($xhtml ? 'application/xhtml+xml' : 'text/html') . '; charset=UTF-8'); if ($xhtml) echo '' . "\n"; ?>