3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $your_array = array(array(1, 2, 'last'), array(3, 4, 'last')); $arr = array(); for($i = 0 ; $i< count($your_array) -1 ; $i++) { for($j = 0 ; $j< count($your_array[$i]) -1 ; $j++) { $arr[] = $your_array[$i][$j]; } } print_r($arr);
Output for 4.3.0 - 7.1.0
Array ( [0] => 1 [1] => 2 )