Created
October 21, 2014 00:34
-
-
Save emestee/229a4e896b95da5118cc to your computer and use it in GitHub Desktop.
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
function removeDuplicates($firstArray, $secondArray, $byTheKey) | |
{ | |
$collect = array(); | |
$walker = function($v, $k) use(& $collect, $byTheKey) { $collect[$v[$byTheKey]] = $v; }; | |
array_walk(array_merge($firstArray, $secondArray), $walker); | |
return $collect; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment