您的位置:首页 > 产品设计 > UI/UE

json_decode($json, true) true什么意思

2017-04-14 14:18 1256 查看
<?php
$json = '{"a":1,"b":2,"c":3,"d":4,"e":5}';

var_dump(json_decode($json));
var_dump(json_decode($json, true));

?>


结果:

object(stdClass)[1]
public 'a' => int 1
public 'b' => int 2
public 'c' => int 3
public 'd' => int 4
public 'e' => int 5

array (size=5)
'a' => int 1
'b' => int 2
'c' => int 3
'd' => int 4
'e' => int 5


true返回值是数组,否则返回值为object
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐