So as I read at the W3C I could add a XML directive at the beggining of my file like this:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://ift.tt/mOIMeg">
But my file needs to be dynamic and that's why I used the .php extension. Sure I can echo '<?xml version="1.0" encoding="UTF-8" ?>'; before the DOCTYPE but the content-type remains text/html and if I change it in my PHP headers to application/xhtml+xml, cahrset=UTF-8 I am prompted for download. I know I could just use the text/html content-type but I want to have at least valid xHTML (and CSS). I've always been following the standards and I got used to it. I won't start writing invalid HTML/xHTML.
EDIT:
Here's the code:
header('Content-Type: application/xhtml+xml; charset=UTF-8');
No comments:
Post a Comment