Hi guys i have a simple XML document :
<iPhone>
<enAttente>
<UDID>value</UDID>
<adresse>value</adresse>
</enAttente>
<enAttente>
<UDID>value</UDID>
<adresse>value</adresse>
</enAttente>
</iPhone>
I want to delete <enAttente> where <adresse> = myValue this is what i do :
$doc = new DOMDocument;
$doc->load('./folder/myFile.xml');
if ($doc)
{
$domNodeList = $doc->getElementsByTagname('enAttente');
for ($i = 0; $i < count($array); $i++)
{
foreach ($domNodeList as $domElement ) {
$authors = $domElement->getElementsByTagName( "adresse" );
$author = $authors->item(0)->nodeValue;
if ($author == "myValue")
{
echo"Founded ! Delete this node ! -- ";
// HOW CAN I DELETE this <enAttente> !!
}
}
}
$doc->saveXML();
}
Can someone telle how to delete element when i have found the one to delete ? thank you very much !