array_chunk
laravel/framework
Supported Versions: PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
Split an array into chunks
array_chunk
(array
$array
,
int $length
,
bool $preserve_keys
=
false
): array
$chunks
= [];
foreach (
array_chunk
(
$this
->
items
,
$size
,
true
) as
$chunk
) {
$chunks
[] = new static(
$chunk
);
}
src/Illuminate/Collections/Collection.php