xpath("//item[@showcase='yes']"); #$xpresult = xpath_eval($xpath, "//item[@showcase='yes']"); if (!$xpresult) { include("badcat.php"); } $item = $xpresult; $s = simplexml_import_dom($item); $xml = new SimpleXMLElement(file_get_contents($xmlfile)); $result = $xml->xpath("//item[@showcase='yes']"); foreach((array)$result as $key=>$node) { $code = (string)$node->code; $name = (string)$node->name; $key = (string)$node['key']; $new = (string)$node['new']; $cost = (string)$node->price; $description = $node->description; $items[$code]['new'] = $new; $items[$code]['sale'] = $node->sale; $items[$code]['name'] = $name; $items[$code]['key'] = $key; $items[$code]['exp'] = $node->exp; $items[$code]['code'] = $code; $items[$code]['cost'] = money_format("%i",$cost); $items[$code]['desc'] = $description; } //echo "
"; print_r($items);exit();
?>