Posted By

axolx on 10/28/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

AllKnightAccess


Pretty print (format) XML with PHP DOM


 / Published in: PHP
 

  1. <?php
  2.  
  3. $doc = new DOMDocument();
  4. $doc->preserveWhiteSpace = false;
  5. $doc->formatOutput = true;
  6. $doc->load('my.xml');
  7.  
  8. print $doc->saveXML();

Report this snippet  

You need to login to post a comment.