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\")
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);