for
, но без foreach
. Как и заказывали.$array_given = [0 =>
[
0 => 904,
1 => 928,
2 => 937],
1 =>
[
0 =>351,
1 =>352,
2 =>353],
2 =>
[
0 =>903,
1 =>972,
2 =>974]
];
print json_encode($array_given);
$array_out = [];
for ($i = 0 ; $i != count($array_given) ; $i++) {
$array_out = array_merge($array_out, $array_given[$i] );
}
print json_encode($array_out);