3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $cars=Array ( array('lnk' => 'Volvo', 'a' => 'BMW'), array('lnk' => 'Toyota', 'a' => 'Honda'), array('lnk' => 'Mercedes', 'a' => 'Opel') ); $arr_chnks = array_chunk($cars,2); foreach($arr_chnks as $arr_chnk){ print_r($arr_chnk); echo "<br>"; } ?>
based on 5sY58
Output for 4.3.0 - 7.1.0
Array ( [0] => Array ( [lnk] => Volvo [a] => BMW ) [1] => Array ( [lnk] => Toyota [a] => Honda ) ) <br>Array ( [0] => Array ( [lnk] => Mercedes [a] => Opel ) ) <br>