Skip to content

Instantly share code, notes, and snippets.

@collinprice
Created March 10, 2014 19:04
Show Gist options
  • Save collinprice/9471970 to your computer and use it in GitHub Desktop.
Save collinprice/9471970 to your computer and use it in GitHub Desktop.
Strip Keys from array.
<?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