求解答:PHP做天气预报采集程序,根据访问者的ip,判断得出当前城市天气预报。

解决方案 »

  1.   

    先获取用户ip  通过ip得到用户所在地,然后通过所在地获取天气信息,下面是两个接口:http://counter.sina.com.cn/ip/http://www.google.com/ig/api?hl=zh-cn&weather=shanghai
      

  2.   

    Google的天气api  weather参数可以填中文http://www.google.com/ig/api?hl=zh-cn&weather=上海
      

  3.   

    应该有好多现成的webservice,直接调用show出来就可以了
      

  4.   

    查询IP物理地址
    http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js天气预报
    http://m.weather.com.cn/data/101190101.html城市代码,可以有很多方法拿到,自己想办法吧