How to convert two dimensional array to one dimensional array in php?

前端 未结 6 1039
太阳男子
太阳男子 2021-02-01 11:17

I am Having an mutidimensional array getting result like given below

Array
(
    [0] => Array
        (
            [0] => 70
        )

    [1] => Arra         


        
6条回答
  •  南方客
    南方客 (楼主)
    2021-02-01 11:51

    You can try

    $it =  new RecursiveIteratorIterator(new RecursiveArrayIterator($data));
    $l = iterator_to_array($it, false);
    
    var_dump($l); // one Dimensional 
    

提交回复
热议问题