Remove first levels of identifier in array

前端 未结 7 1065
天涯浪人
天涯浪人 2020-12-15 11:25

I think this has been up before, but could\'nt find any answer to it. If it\'s already answered please point me in the right direction with a link.

I have an array t

7条回答
  •  一生所求
    2020-12-15 11:52

    Below code will also achieve the same result.

    $resultArray = array_map('current',$inputArray);
    

    OR

    $resultArray = array_map('array_pop',$inputArray);
    

    Note: I have ignored OP's expected result keys. Because it is not possible to have the same keys in the array. The last key will replace the previous one if the same.

提交回复
热议问题