小编Jer*_*oen的帖子

Json解码并在php中显示

所以我有一份当地天气详情列表,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)

php json

6
推荐指数
1
解决办法
380
查看次数

标签 统计

json ×1

php ×1