<?php
//IN CHUNKS OF 2
$subjects = array("Math","Physics","Chemistry","English");
print_r(array_chunk($subjects,2));
?>
PHP inbuilt function array_chunk() can be used to split the array into chunks of given size value.
Syntax
array_chunk($array, $size, hold_keys)
0 Comments