Over a million developers have joined DZone.

Serving XHTML With PHP

DZone's Guide to

Serving XHTML With PHP

· ·
Free Resource
How to correctly serve XHTML with PHP:

header('Vary: Accept');
if (stristr($_SERVER[HTTP_ACCEPT], 'application/xhtml+xml')) 
     header('Content-Type: application/xhtml+xml; charset=utf-8');
     header('Content-Type: text/html; charset=utf-8');


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}