On Fri, Sep 4, 2009 at 10:23 AM, Matthew Croud wrote:
>
> 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('i
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
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
Hi foks,
Could someone lend me a little hand with simpleXML ?
I've been looking at examples in the PHP manual and W3C, i'm at the
pinnacle of figuring it out but alas i need a hand from the mailing
list dudes.
My aim is to add another "item" node, so i'll start with my XML file
called "it
4 matches
Mail list logo