This is basically what I’m trying to do:
$xml = '<root><item attr="1"><notes>item 1 notes</notes></item><item attr="2"><notes>item 2 notes</notes></item></root>';
$xmlObject = simplexml_load_string(xml);
//The XML Info will be modified and updated via loops and other stuff in here.
$updatedXml = $xmlObject converted back to string
To clarify, I’m converting an XML formatted string into a Simple XML object in PHP then in between i’m making alterations and updates to the XML object.
The thing I can’t figure out is how to get it back into string format.
Thanks for any help!
Use the
asXMLfunction: http://www.php.net/manual/en/simplexmlelement.asxml.php