PHP头条
热点:

php利用GoogleAPI获取当前天气信息代码


本文章分享一款只要三行就能取得你指定城市天气信息的php+google api实现代码,有需要的朋友可以参考一下。

代码如下

$xml = simplexml_load_file('http://www.google.com/ig/api?weather=长沙');
$information = $xml->xpath("/xml_api_reply/weather/current_conditions/condition");
echo $information[0]->attributes();

?>



www.phpzy.comtrue/phpyy/4917.htmlTechArticlephp利用GoogleAPI获取当前天气信息代码 本文章分享一款只要三行就能取得你指定城市天气信息的php+google api实现代码,有需要的朋友可以参考一下。 代码如下 $xml = simplexml_load_file('http:/...

相关文章

相关频道:

PHP之友评论

今天推荐