Reputation: 147
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>
Upvotes: 1
Views: 882
Reputation: 27876
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;
Upvotes: 4