0
<?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

1

1 Answer 1

0

Remove the child element from the parent node.

PHP Simple XML remove all Children

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.