<?xml version="1.0"?> <rights> <visitor> <user>updateUsers</user> <user>deleteUsers</user> <user>createUsers</user> <user>readUsers</user> </visitor> </rights> This is the xml file i am using. I want to delete the nodes depending on their values. Eg if the user want me to remove the entry for updateUsers then i could remove the <user> that has value updateUsers. I want to do it using php. here is my script
$xmlobj=simplexml_load_file($xmlpath); foreach($xmlobj->{$owner}[0]->children() as $mychild) { $childvalues[]=$mychild; } foreach($childvalues as $values) { if($userentry==$values) { //code to remove that node } } I am struck with it. Help will be very much appreciated