Skip to content

Instantly share code, notes, and snippets.

@NapoleonWils0n
Created November 3, 2012 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NapoleonWils0n/4005399 to your computer and use it in GitHub Desktop.
Save NapoleonWils0n/4005399 to your computer and use it in GitHub Desktop.
php: set content type for xml
<?php
if (stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
header("Content-type: application/xhtml+xml");
echo '<?xml version="1.0" encoding="UTF-8"?>';
}
else { header("Content-type: text/html"); }
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment