Organizational Research By

Surprising Reserch Topic

array_chunk — Split an array into chunks


Chunks an array into arrays with size elements. The last chunk may contain less than size elements.

Parameters

array
The array to work on

size
The size of each chunk

preserve_keys
When set to TRUE keys will be preserved. Default is FALSE which will reindex the chunk numerically

Return Values

Returns a multidimensional numerically indexed array, starting with zero, with each dimension containing size elements.

Errors/Exceptions

If size is less than 1 E_WARNING will be thrown and NULL returned.

Examples
asked May 25, 2015 in PHP by rahulgii
0 votes
32 views



Related Hot Questions



Government Jobs Opening


...