php merge arrays

前端 未结 6 1806
北海茫月
北海茫月 2021-01-21 08:33

I have been trying (unsuccessfully) to merge the output of multiple arrays into a single array. An example of what I tried was:

$data1 = array(\"cat\", \"goat\")         


        
6条回答
  •  半阙折子戏
    2021-01-21 08:54

    modify your last foreach loop to look like this:

    $output=array();
    foreach($lines as $inner){
        $output[]=$inner[1];
    }
    header('Content-type: text/plain; charset=utf-8');
    print_r($output);
    

提交回复
热议问题