我如何压扁以下数组。我想摆脱0和1,只需要0-5作为键。我顺便使用php。
Array
(
[0] => Array
(
[0] => Array
(
[id] => 182
)
[1] => Array
(
[id] => 183
)
[2] => Array
(
[id] => 185
)
[3] => Array
(
[id] => 184
)
[4] => Array
(
[id] => 186
)
)
[1] => Array
(
[0] => Array
(
[id] => 171
)
)
)
答案 0 :(得分:0)
$flatArray = array();
foreach ($array as $l1Array){
foreach ($l1Array as $k => $v){
$flatArray[]=$v;
}
}