开发者

How to save a neatly formatted XML file using Simple XML?

What's the "trick" to save an XML file that visually would result neatly formatted?

such as:

<xml>
   <item>foo</i开发者_开发技巧tem>
</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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜