所以我有一份当地天气详情列表,http://api.openweathermap.org/data/2.5/weather?q = Schimmert,nl.我希望在我的网站上通过php显示其中的一些信息,但无法真正了解JSON对我来说是一个全新的东西.
我现在唯一能做的就是:http://jeroenonline.biz/JSON/index.php.所以这是一个简单的脚本:
$getData = file_get_contents( "http://api.openweathermap.org/data/2.5/weather?q=Schimmert,nl");
$decode = json_decode($getData);
echo "<pre>";
print_r($decode);Run Code Online (Sandbox Code Playgroud)