- file_get_contents: documentation ( source)
<?php
$xmlstr = file_get_contents('http://designdelicatessen.com/_source/modules/shop_priceindex/export.php?index=test&iso=uk&site=1');
$feed = new SimpleXMLElement($xmlstr);
function findPrice($feed, $id){
foreach($feed->Products->Product as $product){
if($product->Number == $id){
return $product->Price;
}
}
return null;
}
echo findPrice($feed, 'swv8813');
echo "\n";
echo findPrice($feed, 'swv8814');