The array_chunk() function is an inbuilt function in PHP which is used to split an array into parts or chunks of given size depending upon the parameters passed to the function. The last chunk may contain fewer elements than the desired size of the chunk.
Syntax:
array array_chunk( $array, $size, $preserve_keys )
Parameters: This function accepts three parameters as shown in the above syntax. The parameters are described below: