I'm developing a web app. Right now it's going by pretty easily. Unfortunately, I'm having trouble writing to an XML file and it's beginning to get hairy over here. So, my question is this: How can I take this code and make it add to my already started XML file?
Code:
$newNode = "<allusers></allusers>";
$xmlRoot = simplexml_import_dom($xmlDoc);
foreach ($parr as $nodes => $vals) {
$txt = "<" . $nodes . ">" . $vals . "</" . $nodes . ">\n";
}
$xmlRoot->addChild("<user>",$txt);
echo $xmlRoot->asXML();
Comment