Created
February 13, 2023 18:16
-
-
Save codearachnid/b270724fee1e16e53895f7d2aef805a7 to your computer and use it in GitHub Desktop.
Because PHP is lacking an array diff for keys within array check
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 | |
if(!function_exists('array_keys_exists')){ | |
function array_keys_exists(array $keys, array $arr) { | |
return !array_diff_key(array_flip($keys), $arr); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment