Created
March 10, 2014 19:04
-
-
Save collinprice/9471970 to your computer and use it in GitHub Desktop.
Strip Keys from array.
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 | |
class Helpers { | |
public static function stripKeys(array $myArray, array $keys) { | |
foreach ($myArray as $key => $value) { | |
if (in_array($key, $keys)) { | |
unset($myArray[$key]); | |
} | |
} | |
return $myArray; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment