PHP
Split array in smaller arrays
To divide an array and split it into smaller sub-arrays by size, you can use the PHP function array_chunk():
$sections = array_chunk(array('k', 'l', 'm', 'n', 'o'), 2);
To divide an array and split it into smaller sub-arrays by size, you can use the PHP function array_chunk():
$sections = array_chunk(array('k', 'l', 'm', 'n', 'o'), 2);