Convert multidimensional array into single array

后端 未结 20 1593
时光取名叫无心
时光取名叫无心 2020-11-22 10:39

I have an array which is multidimensional for no reason

/* This is how my array is currently */
Array
(
[0] => Array
    (
        [0] => Array
                


        
20条回答
  •  逝去的感伤
    2020-11-22 11:04

     $singleArray = array();
    
        foreach ($multiDimensionalArray as $key => $value){
            $singleArray[$key] = $value['plan'];
        }
    

    this is best way to create a array from multiDimensionalArray array.

    thanks

提交回复
热议问题