Skip to content

Instantly share code, notes, and snippets.

@codearachnid
Created February 13, 2023 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codearachnid/b270724fee1e16e53895f7d2aef805a7 to your computer and use it in GitHub Desktop.
Save codearachnid/b270724fee1e16e53895f7d2aef805a7 to your computer and use it in GitHub Desktop.
Because PHP is lacking an array diff for keys within array check
<?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