PHP - unset in a multidimensional array

后端 未结 5 395
长发绾君心
长发绾君心 2020-12-03 17:17

I have this array $output which looks like this:

Array(
    [0] => Array(
        [0] => 1a
        [1] => 1b
        [2] => 1c
    )
    [1] =&g         


        
5条回答
  •  渐次进展
    2020-12-03 18:20

    Can't be done with a simple command, but you can use a loop:

    foreach(array_keys($output) as $key) {
       unset($output[$key][1]);
    }
    

提交回复
热议问题