在php中,我有一个这样的数组:
[
[0] =>
[
[0] => 255
[1] => 216
[2] => 255
]
[1] =>
[
[0] => 25
[1] => 54
[2] => 25455
]
]
现在我想要这样的数组:
[
[0] => 255
[1] => 216
[2] => 255
]
[
[0] => 25
[1] => 54
[2] => 25455
]
有什么好主意吗?用PHP语言!
答案 0 :(得分:1)
检查一下,
<?php
$arr = [
0 =>
[
0 => 255,
1 => 216,
2 => 255,
],
1 =>
[
0 => 25,
1 => 54,
2 => 25455,
]
];
echo json_encode($arr);
<强>输出强>
[[255,216,255],[25,54,25455]]
这是工作demo,
json_encode - 返回值
的JSON表示