Jump to content

xml declaration and php


~Shinta
 Share

Recommended Posts

Hi. I've been having a problem converting my site to php. First off, my html files use the xml declaration on all teh pages. When I run it through the php parser it picks up the xml declaration (which ofcourse has has <? in it) and generates an error. I need a way to fix this. I tried to fix it with the ascii code for ?, but then the browser doesn't pick up the declaration tag at all. I want to remain valid xhtml 1.1 and use php. Also, I want to use ssi includes <!--#include--> in php document. It isn't really a big deal, but I want something so my site will still operate during the conversion (when I use the include() object instead.)

Link to comment
Share on other sites

Either turn off the <? shortcut in your php.ini or do something like this:

<?phpecho '<'.'?xml version="1.0" encoding="utf-8"?'.'>';?>

That should result in <?xml version="1.0" encoding="utf-8"?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...