Possible Duplicate:
A simple program to CRUD node and node values of xml file
This is an example XML file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<notes>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
</notes>
How to add another note (with all its elements) using SimpleXML?
addChild() adds only a child to an existing tree, as far as I know.
Well, first I’d get a better reference. Maybe the PHP manual, which is a great resource:
http://www.php.net/manual/en/simplexml.examples-basic.php#example-5118
This adds a node to your
noteslist:http://codepad.org/QrlU5CYm
You are looking at the right one. You just have to load the XML first, in whatever form it comes in.