<?php function removNode($myXML, $node, $attribute, $id) { $xmlDoc = new DOMDocument(); $xmlDoc->load($myXML); $xpath = new DOMXpath($xmlDoc); if( $attribute!='' || $id!='' ) $nodeList = $xpath->query('//'.$node.'[@'.$attribute.'="'.$id.'"]'); else $nodeList = $xpath->query('//'.$node.''); if ($nodeList->length) { $node = $nodeList->item(0) ; $node->parentNode->removeChild($node); } $xmlDoc->save($myXML) ; } ?>
Management Games