0
我想從雅虎請求YQL結果返回所有「名」的值返回地名,但我得到的是一個空白頁:(這是我到目前爲止的代碼:如何從雅虎YQL結果XML
$input = $_GET['str'];
$yql = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.places%20where%20text%20='".$input."'";
$feed = file_get_contents($yql);
$xml = simplexml_load_string($feed);
echo $xml->query->results->place->name;
我如何解析和名稱爲「名」返回所有的XML值
返回的XML結構示例:sample
非常感謝您的幫助:)
!
非常感謝您的回答! :)我的最後一個問題:我怎樣才能以這種方式訪問國家代碼(烏拉圭 - >「UY」)和緯度和經度值質心部分?看來,這些屬性是與json_decode :( –
VORiAND
@VORiAND他們不一定丟失:)丟失,你可以檢查編輯 – user1978142