php的json_encode函数问题
程序员文章站
2022-06-01 23:44:39
...
php的json_encode函数问题: $ary = []; $ary[0] = 'a'; $ary[1] = 'b'; echo json_encode($ary) . 'br'; echo json_encode($ary, JSON_FORCE_OBJECT); 结果: ["a","b"] {"0":"a","1":"b"}
php的json_encode函数问题:
$ary = [];
$ary[0] = 'a';
$ary[1] = 'b';
echo json_encode($ary) . '
';
echo json_encode($ary, JSON_FORCE_OBJECT);
结果:
["a","b"]
{"0":"a","1":"b"}
上一篇: 又是一周-AJAX(三)
下一篇: Yii2的深入学习--事件Event