Last active
February 25, 2017 11:34
-
-
Save jeystaats/7dc724500286432cddca50e9c86f3bd3 to your computer and use it in GitHub Desktop.
Difference in Collection ( Laravel )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$array1 = ['Rocket','Thruster','Space']; | |
$array2 = ['Rocket','Rocks','Space']; | |
$collection = collect($array1); | |
$intersect = $collection->intersect($array2); | |
var_dump($intersect ) | |
// $intersect = ['Rocket','Space']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment