Jump to content

delete node with simplexml


crataegus

Recommended Posts

Hi everybody,

 

I'm quite new here and found already a lot of answers to my questions - a big "thank you" to every phpfreak!

 

In this topic http://www.phpfreaks.com/forums/index.php/topic,227933.msg1052509.html#msg1052509 I found a very good way how to change and add nodes with simplexml. The only thing missing for my project is a way how to get rid of one node. OK, there is a way of going through every node, comparing inner values and then doing an unset() to the found node. But considering the answers in the mentioned topic I'm wondering if there is a simpler way?!?

 

unset($xml->xpath('/A/B[@id=24]')); does not work. Only if I specify the array-number ... and that is not very comfortable when searching for special values, coming from a form.

 

 

Link to comment
https://forums.phpfreaks.com/topic/142274-delete-node-with-simplexml/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.