XML Prolog in PHP

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!

Leave a Reply

Your email address will not be published.