Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel collection intersect

$collection = collect(['Desk', 'Sofa', 'Chair']);

$intersect = $collection->intersect(['Desk', 'Chair', 'Bookcase']);

$intersect->all();

// [0 => 'Desk', 2 => 'Chair']
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #collection #intersect
ADD COMMENT
Topic
Name
8+6 =