Apr
2008
17
 posted at 10:55 pm filed under: PHP
* * *     2 votes

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 Trackback

Leave A Reply

 Username (*required)

 Email Address (*private)

 Website (*optional)

Ramblings of a Deluded Mind
Loading...
Login
Register

A password will be mailed to you
Retrieve password

A confirmation mail will be sent to your e-mail address
AddThis Feed Button AddThis Social Bookmark Button
Contact Me
  1. (required)
  2. (valid email required)
  3. (required)
 

cforms contact form by delicious:days