Answer the question
In order to leave comments, you need to log in
How to remove nesting in an array?
There is such an array:
Array
(
[0] => Array
(
[0] => 6
[1] => 10
[2] => 59
[3] => 175
)
[1] => Array
(
[0] => 896712
[1] => 898015
[2] => 898018
)
[2] => Array
(
[0] => 900000
[1] => 900001
)
)
Array
(
[0] => 6
[1] => 10
[2] => 59
[3] => 175
[0] => 896712
[1] => 898015
[2] => 898018
[0] => 900000
[1] => 900001
)
Answer the question
In order to leave comments, you need to log in
<?php
$in = ;
$out = [];
array_walk_recursive($in, function($in) use (&$out) { $out[] = $in; });
print_r($out);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question