PHP pearls
Posted by Jorge Bernal January 11, 2007
Found this in the PHP manual:
Note: Also note that if you are embedding PHP within XML or XHTML you will need to use the <?php ?> tags to remain compliant with standards.
What?? Who cares?? I mean, this embedded PHP code is meant to be seen only by the PHP interpreter, parsed and sent back to the client as XML or XHTML, so what’s the point here?

It has nothing to do with PHP. Processing instructions in XML data have to be well formed.
The PHP manual is right to recommend good practices. If you like to valid your XML data when they contain PHP processing instruction.
For the record, PHP allows both “< ?" (short tag) and "
More info about PI:
http://www.w3.org/TR/REC-xml/#sec-pi