0
我在這裏失蹤?我得到的返回是「地點:0」解析XML返回的結果從api url調用與PHP的錯誤
ini_set("user_agent","Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
$url = "http://ebird.org/ws1.1/data/notable/region/recent?rtype=subnational1&r=US-AZ";
$xml = simplexml_load_file($url);
$locname = $xml->response->result->sighting->loc-id;
echo "Location: ".$locname . "<br/>";
'LOC-ID '可能是一個錯字。你的意思是'loc-> id'? – Cfreak