table数据表格能否获取二,三维维的json?

提问 未结
0 31
海于咸
海于咸 2018-12-6
悬赏:20飞吻
版本:layui 浏览器:
我使用php写的,用直接用json_encode();将三维array转换为json格式。
php数组如下:
array (size=2)
's1407020219' =>
array (size=4)
'firstname' => string '张振兴' (length=9)
'correct' => int 2
'第1题' =>
array (size=3)
'state' => string 'complete' (length=8)
'fraction' => string '1.0000000' (length=9)
'timecreated' => int 1544081819
'第3题' =>
array (size=3)
'state' => string 'complete' (length=8)
'fraction' => string '1.0000000' (length=9)
'timecreated' => int 1544081846
's1407020217' =>
array (size=2)
'firstname' => string '张晨晨' (length=9)
'correct' => int 0


我想让一维数组的键没有,现在的json是这样的:

{"s1407020219":
{"firstname":"\u5f20\u632f\u5174",
"correct":2,"\u7b2c1\u9898":{"state":"complete","fraction":"1.0000000","timecreated":1544081819},
"\u7b2c3\u9898":{"state":"complete","fraction":"1.0000000","timecreated":1544081846}
},
}
回帖
  • 消灭零回复