这个无需PHP做。前端就可以获取,直接搜索天气API,会有很多天气接口。http://www.weather.com.cn/data/sk/101010100.html或者http://cj.weather.com.cn/
http://m.weather.com.cn/atad/101010100.html101010100是北京的编号,你查找你当地的编号,如果你想获取访问者当地的天气预报,你可以根据ip来判断
给你两个看下 http://hi.baidu.com/fanglor/blog/item/b752368b613c14dafd1f10b1.html http://blog.csdn.net/tatoo108/archive/2009/08/29/4493263.aspx
补从说明一下,只要一个地区的天气预报程序 要的是山东->日照->莒县的