Created
July 24, 2018 16:09
-
-
Save vfalconi/38ef1e6d776023beb2d353aaadd2db6d 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
// finds interesection between the keys of $array and the values of $comparisonList | |
function array_keys_intersect_list($array, $comparisonList) | |
{ | |
$intersections = []; | |
foreach ($comparisonList as $item) { | |
if (array_key_exists($item, $array)) $intersections[] = $item; | |
} | |
return $intersections; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment