php - SimpleXMLElement Object back to XML -
this question has answer here:
- php xml how output nice format 5 answers
let's you're getting following response api call:
[orderarray] => simplexmlelement object ( [order] => array ( [0] => simplexmlelement object ( [orderid] => etc...etc..<br> how go converting well-formatted xml can save each of order arrays own separate file? (please don't ask me why have perform seemingly futile task.)
$sxml simplexmlelement
$doc = new domdocument(); $doc->formatoutput = true; $doc->loadxml($sxml->asxml()); $xml = $doc->savexml();
Comments
Post a Comment