$typeID = 34;
$reader = simplexml_load_file("http://api.eve-central.com/api/quicklook?typeid=".$typeID);
foreach ($reader -> buy_orders -> order as $orderrow) {
if($orderrow->price > $bestPrice)
{
if($orderrow->security >= "0.5")
{
$bestPrice = $orderrow->price;
$bestStation = $orderrow->station_name;
$bestStationID = $orderrow->station;
}
}
}
Warning: Invalid argument supplied for foreach()
,我不明白爲什麼。這裏的想法是貫穿在那裏列出的每個買單,並比較價格,如果訂單更高,則將其設置爲最佳。這樣做直到所有訂單完成,變量將列出最佳價格,最佳電臺和稍後使用的stationID。我查了一些StackOverflow的問題,引用等等。許多例子報告三深都很好,所以我不明白這是一個無效的參數。
任何想法?