3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $citylist = array( "Black Canyon City", "Chandler", "Flagstaff", "Gilbert", "Glendale", "Globe", "Mesa", "Miami", "Phoenix", "Peoria", "Prescott", "Scottsdale", "Sun City", "Surprise", "Tempe", "Tucson", "Wickenburg" ); print_r( array_chunk($citylist, 3));
Output for 4.3.0 - 7.1.0
Array ( [0] => Array ( [0] => Black Canyon City [1] => Chandler [2] => Flagstaff ) [1] => Array ( [0] => Gilbert [1] => Glendale [2] => Globe ) [2] => Array ( [0] => Mesa [1] => Miami [2] => Phoenix ) [3] => Array ( [0] => Peoria [1] => Prescott [2] => Scottsdale ) [4] => Array ( [0] => Sun City [1] => Surprise [2] => Tempe ) [5] => Array ( [0] => Tucson [1] => Wickenburg ) )