Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel collection split

$collection = collect([1, 2, 3, 4, 5]);

$groups = $collection->split(3);

$groups->toArray();

// [[1, 2], [3, 4], [5]]
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #collection #split
ADD COMMENT
Topic
Name
3+8 =