作者:你的拥吻像情歌一样凄美_207 | 来源:互联网 | 2023-07-11 10:50
This question already has an answer here:
这个问题在这里已有答案:
- json_encode not preserving order 2 answers
- json_encode不保留2阶的答案
I have a associative array
我有一个关联数组
Array(
[289] => Array(
'name'=> 'One'
),
[292] => Array(
'name'=> 'One'
),
[290] => Array(
'name'=> 'One'
)
)
After i use json_encode on this array. The keys are sorted, although i get it as JSON object.
我在这个数组上使用json_encode后。键被排序,虽然我把它作为JSON对象。
Is there way to prevent this behaviour?
有办法防止这种行为吗?
2 个解决方案