Created
April 9, 2019 01:24
-
-
Save adamcrampton/268b8fbc9be5a2cc2945ef153cfd68f9 to your computer and use it in GitHub Desktop.
Trims array keys specified in another array
This file contains hidden or 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 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