Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel collection partition

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

list($underThree, $aboveThree) = $collection->partition(function ($i) {
    return $i < 3;
});
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #collection #partition
ADD COMMENT
Topic
Name
2+4 =