PHP array_chunk() function is used to split an array into chunks. The array_chunk() function is PHP built-in function.
PHP array_chunk() function divides array into small parts by specifying length.
Syntax :
array_chunk($array,$length,$preserve_keys);
Parameter,
$array : Required. It is type of array parameter.
$length : Required. It is size of ech chunk aray.
$preserve_keys : Optional. If it is true, keys will be preserved. Default is FALSE which will re-index the chunk numerically.
Let's see below example to understand php array_chunk() Function in details.
Comments