XML Prolog in PHP

Posted January 5, 2012

Okay, I get it. For some PHP programmers, the notion of the PHP short-code being the same as the open and close of the XML prolog is enough to throw you into a foaming rage.

However - of all the "solutions" I've seen, this has to be the worst:

<?php echo ("<"); ?>?xml version="1.0" encoding="UTF-8"?<?php echo ">"; ?>

Come on now, guys ... really?! That's a good solution, is it? Hey, here's an easy one, just for all of you who get confused and don't like using short-codes:

<?= '<?xml version="1.0" encoding="UTF-8"?>' ?>

Geez, guys, seriously, it's not that big of a deal!

Comments

There are no comments for this post.

No comments found

Add comment

Visit my Friends and Family

If you've enjoyed my site, please take a moment to visit my friends and family, many of whom have some interesting insights, and entertaining thoughts and ideas.