This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

PHP Arrays

array_chunk() Function

Array ( [0] => Array ( [0] => Volvo [1] => BMW ) [1] => Array ( [0] => Toyota [1] => Honda ) [2] => Array ( [0] => Mercedes [1] => Opel ) )

<?php
// the index array to be split into 2 chunks
$cars=array("Volvo","BMW","Toyota","Honda","Mercedes","Opel");

// split $car array into 2 chunks and display the results
print_r(array_chunk($cars,2));
?>