Re: [PHP] Some help with SimpleXML :`(

2009-09-04 Thread Matthew Croud
Well, you guys are awesome. So the script below doesn't cause any errors (nice), however it doesn't save the newly added child to the xml file (items.xml): $xml = simplexml_load_file("items.xml"); $item = $xml->addChild('item'); $item->addChild('name', $name); $item->addChild('desc', $des

Re: [PHP] Some help with SimpleXML :`(

2009-09-03 Thread J DeBord
You almost had it... Since clothes is the root element you can think of your initial $xml as . So, you add a child to it. That error message is kinda cryptic though. Red Gloves a pair of red gloves adult 12.99 Snow Boots some snow boots child 23.99 EOD; $sxm