Add data in xml at certain node

cuafkuyhlc

New Member
I have a nested xml file to which I want to insert elements under certain nodes. The xml structure is like:\[code\]<root> <item id="1"> <content><name>ITEM 1</name></content> <item id="3"> <content><name>ITEM 3</name></content> <item id="4"> <content><name>ITEM 4</name></content> </item> </item> </item> <item id="2"> <content><name>ITEM TWO</name></content> </item></root>\[/code\]Suppose that I want to insert some Item as a child of item id 4, using php what would the syntax be to find the node of item 4 and append another item node in it?
 
Back
Top