i want to display the cheapest 3 pairs from pairs.xml file , now i am confused how to use a condition for it .can anybody help me out
pairs.xml------------
<pairs>
<pair>
<name>cups</name>
<price>50</price>
</pair>
<pair>
<name>mugs</name>
<price>60</price>
</pair>
<pair>
<name>plates</name>
<price>40</price>
</pair>
<pair>
<name>spoons</name>
<price>10</price>
</pair>
</pairs>
pairs.php----------
$xmlFile = "pairs.xml";
$doc = DOMDocument::load($xmlFile);
$pair = $doc->getElementsByTagName("pair");
echo "<table border=1><tr><th>Name</th><th>Price</th></tr>";
foreach ($pair as $node) {
$name = $node->getElementsByTagName("name");
$name = $name->item(0)->nodeValue;
$price = $node->getElementsByTagName("price");
$price = $price->item(0)->nodeValue;
if ()
echo "<tr><td>{$name}</td><td>{$price}</td><tr>";
}