我正在使用openweathermap.org api,它提供了不正确的输出。
如果我点击这个 url,我会得到以下输出:
"{"coord":{"lon":-121.96,"lat":37.83},"weather":[{"id":721,"main":"Haze","description":"haze","icon":"50n"}],"base":"stations","main":{"temp":281.21,"pressure":1030,"humidity":81,"temp_min":273.15,"temp_max":285.15},"visibility":11265,"wind":{"speed":1.07,"deg":54.0019},"clouds":{"all":1},"dt":1454739836,"sys":{"type":1,"id":409,"message":0.0189,"country":"US","sunrise":1454771247,"sunset":1454809012},"id":5342970,"name":"Diablo","cod":200}"
如果我通过 phpcurl
或调用相同的 url file_get_contents
,我会得到以下输出:
"{"coord":{"lon":-121.96,"lat":37.83},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"base":"cmc stations","main":{"temp":275.178,"pressure":1022.49,"humidity":83,"temp_min":275.178,"temp_max":275.178,"sea_level":1043.42,"grnd_level":1022.49},"wind":{"speed":1.07,"deg":356.501},"clouds":{"all":12},"dt":1454738179,"sys":{"message":0.0112,"country":"US","sunrise":1454771247,"sunset":1454809011},"id":5342970,"name":"Diablo","cod":200}"
为什么它们不同?