Home > Backend Development > PHP Tutorial > 怎么将SimpleXMLElement的asXML方法输出的xml字符串格式化

怎么将SimpleXMLElement的asXML方法输出的xml字符串格式化

WBOY
Release: 2016-06-13 13:24:21
Original
1662 people have browsed it

如何将SimpleXMLElement的asXML方法输出的xml字符串格式化
请问如何将SimpleXMLElement的asXML方法输出的xml字符串格式化?

现在输出的内容相当于完全是放在同一行中。

如何把内容格式化,也就会一个标签一个换行。
以便保存在文件中,查看时美观。

------解决方案--------------------
要不用DOMDocument的saveXML?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template