Asxml (' file.xml ') saved files after processing XML in SimpleXML, no format layout? One line looks at the Bible.
Build an XML file in SimpleXML,
Xml->addchild ()
Xml->addattribute ()
The Horse of God,
Save time Xml->asxml (' file.xml '); The resulting XML file is displayed on one line,
Look and want to be crazy, too disorderly pull.
Can't he just wrap it up and indent it?
Share to:
------Solution--------------------
It seems that there is no ... Only manual substitution plus line break is available:
------Solution--------------------
Add one sentence: $xml->formatoutput = true;
------Solution--------------------
Read the manual tidy module
------Solution--------------------
Wrapping, indenting is meaningless for XML, just adding the size of the XML document in vain (it's already big enough)
What you see in any XML editor (including your browser) is formatted content