代码如下:
<?php
/**
* Google API应用
* 获取某城市的当天天气
* by http://www.jb200.com
*/
$xml = simplexml_load_file('http://www.google.com/ig/api?weather=ADDRESS');
$information = $xml->xpath("/xml_api_reply/weather/current_conditions/condition");
echo $information[0]->attributes();
?>
您可能感兴趣的文章: