Sometimes you just get a brain deadlock on the simplist thing. A few weeks ago I was converting some pages on a site to xhtml 1.0 strict. As you probably know, this requires each page to start with the following xml declaration:
< ?xml version="1.0" encoding="utf-8" ?>
No problem right? Wrong. That decleration is similar to the start of a php decleration:
< ?php
Needless to say it creates an error when you try to load the page. That’s where things went nuts and I was drawing a blank. “This should be easy to do” I kept saying to myself. “What am I missing”. Geesh, how stupid did I feel when it finally hit me. Here’s all you need to do. Put the following php command on the first line of the document:
echo '< ?xml version=\"1.0\" encoding=\"utf-8\"?>\n';
Just figured I’d post this in case someone else had a brain freeze as bad as the one I had.
No user commented in " xml decleration in php "
Follow-up comment rss or Leave a TrackbackLeave A Reply