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?

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Furl
  • Google Bookmarks
  • email
  • StumbleUpon

Most Commented Posts

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

One Response to “PHP pearls”

  1. Pierre says:

    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

Leave a Reply