I need to delete elements of an XML file using PHP. It will be done via ajax and I need to find the XML element via an attribute.
This is my XML file
<?xml version="1.0" encoding="utf-8"?>
<messages>
<message time="1248083538">
<name>Ben</name>
<email>Ben's Email</email>
<msg>Bens message</msg>
</message>
<message time="1248083838">
<name>John Smith</name>
<email>[email protected]</email>
<msg>Can you do this for me?</msg>
</message>
</messages>
So what I would say is something like delete the element where the time equals 1248083838.
Ive been using Simple XML up until now and I've just realised it can do everything except delete elements.
So how would I do this?