I have a file with products:
http://com6.com/items.xml
I want to remove all products priced at less than 200
I have the following code:
<?php
$xml = simplexml_load_file('http://com6.com/items.xml ');
$toDelete = array();
foreach ($xml->PRICE as $PRICE) {
$cena = $PRICE->RETAIL_PRICE;
if ($cena < 200 ) {$toDelete[] = $PRICE; }
}
foreach ($toDelete as $PRICE) {
$dom = dom_import_simplexml($PRICE);
$dom->parentNode->removeChild($dom);
}
$xml->asXML("result.xml");
?>
This code works with other XML files but with this: http://com6.com/items.xml did not work.