加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > PHP > 正文

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

发布时间:2020-05-25 03:01:06 所属栏目:PHP 来源:互联网
导读:?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 1public b = int 2public c = int 3public d = int 4public e = int 5array (size=5)a = int 1b = int 2c =

<div class="cnblogs_code">

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

<span style="color: #0000ff">?>

结果:

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

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读