Page is a not externally linkable
swa66 - 11:31 pm on Jul 26, 2012 (gmt 0)
I've been doing some php scripts that output polyglot xhtml5
Some interesting bits other might find useful:
NOTE: I'm not the best php programmer ever - feel free to correct/add
Output the content-type if the browser is not retarded - obviously do this before outputting anything:
if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")){
header('Content-Type: application/xhtml+xml;charset=UTF-8');
}
function to use instead of htmlentities() so it's only converting the 5 allowed named entities:
function myxmlencode($str) {
$in= array ('&','<','>','"',"'");
$out= array ('&','<','>','"','$apos;');
return(str_replace($in, $out, $str));
}