// Copyright: Copyright (C) 2004-2007 Pristine Communications // xhtml_content_type: Check whether application/xhtml+xml or text/html // should be sent to the client function xhtml_content_type() { // Browsers that claim to support application/xhtml+xml explicitly if ( array_key_exists("HTTP_ACCEPT", $_SERVER) && strpos($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml") !== false) { return "application/xhtml+xml"; } // Browsers that are known to support application/xhtml+xml if (array_key_exists("HTTP_USER_AGENT", $_SERVER)) { // W3C validator can recognize application/xhtml+xml if (substr($_SERVER["HTTP_USER_AGENT"], 0, 13) == "W3C_Validator") { return "application/xhtml+xml"; } } // Else, we assume that application/xhtml+xml is not supported return "text/html"; } ?>