Skip to content

Instantly share code, notes, and snippets.

@adamcrampton
Created April 9, 2019 01:24
Show Gist options
  • Save adamcrampton/268b8fbc9be5a2cc2945ef153cfd68f9 to your computer and use it in GitHub Desktop.
Save adamcrampton/268b8fbc9be5a2cc2945ef153cfd68f9 to your computer and use it in GitHub Desktop.
Trims array keys specified in another array
function trimArrayKeys($originalArray) {
$strip_keys = ['banned_key'];
return array_diff_key($originalArray, array_flip($strip_keys));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment