What's the "trick" to save an XML file that visually would result neatly formatted?
such as:
<xml>
   <item>foo</item>
</xml>
and not:
<xml><item>foo</item></xml>
What's the "trick" to save an XML file that visually would result neatly formatted?
such as:
<xml>
   <item>foo</item>
</xml>
and not:
<xml><item>foo</item></xml>
 
    
     
    
    If the proper format of Xml is important for you instead of SimpleXml use the DOM (also included and much more complex) extension that has a property for this:
$xml->formatOutput = true;
