I have an array which is multidimensional for no reason
/* This is how my array is currently */
Array
(
[0] => Array
(
[0] => Array
Try this it works for me:
$newArray = array();
foreach($operator_call_logs as $array) {
foreach($array as $k=>$v) {
$newArray[$k] = $v;
}
}
Multi dimensional array to single array with one line code !!! Enjoy the code.
$array=[1=>[2,5=>[4,2],[7,8=>[3,6]],5],4];
$arr=[];
array_walk_recursive($array, function($k){global $arr; $arr[]=$k;});
print_r($arr);
...Enjoy the code.