Skip to content

Instantly share code, notes, and snippets.

@aron
Created March 18, 2009 14:30
Show Gist options
  • Save aron/81154 to your computer and use it in GitHub Desktop.
Save aron/81154 to your computer and use it in GitHub Desktop.
function split_array($array, $key_values) {
$sorted_array = array();
foreach($array as $key => $value) {
if(in_array($key, $key_values)) {
$sorted_array[$key] = $value;
}
}
return $sorted_array;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment