Printing multi line XML while maintaining the formatting in PHP
A co-worker of mine introduced me to this tip for maintaining the formatting of multi line information in PHP; in this case it is XML. It uses heredoc. The syntax is basically three <<< and then the name of the type of variable...
Here is a code snippet of it in use:
<?php echo <<<XML <?xml version="1.0" encoding="UTF-8"?> <someNode> {$massiveAmountOfXML} </someNode> XML; ?>