Name

array_chunk

Synopsis

array array_chunk(array array, int size[, int preserve_keys])

Splits array into a series of arrays, each containing size elements, and returns them in an array. If preserve_keys is true (default is false), the original keys are preserved in the resulting arrays; otherwise, the values are ordered with numeric indices starting at 0.

Get Programming PHP, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.