2010-12-21 110 views

回答

0

下面是一个PHP的例子(注:需要从openweathermap.org有效的API-KEY)

$url = 'http://api.openweathermap.org/data/2.5/forecast?q=London,us&mode=xml&appid=<API-KEY>' 
$forecast = file_get_contents($url); 

您可以通过城市得到预测名称,城市ID,纬度&经度等