从 openweathermap 获取天气数据失败。这是我的代码:
$xml = new
SimpleXMLElement(file_get_contents('http://api.openweathermap.org/data/2.5/weather?q=london&mode=xml'));
$country = $xml->code->country;
$city = $xml->code->city;
echo "Country: $country<br/>City: $city";
当我回声时,我什么也得不到。帮助表示赞赏!