Jump to content

XML - Remove child node


harshpandya

Recommended Posts

Here is my XML doc::<root><device> <name>My name</name></device></root>Here is my code : I want to remove name node from the XML and create new one with different node value$root = $xmlDoc->documentElement;$child2 = $root->getElementsByTagName("name")->item(0);$root->removeChild($child2);why this wont work?Thanks,

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...