Simple one, I was just wondering if there is a clean and eloquent way of returning all values from an associative array that do not match a given key(s)?
$array
You could just unset the value:
$alphaAndGamma = $array;
unset($alphaAndGamma['alpha']);
Edit: Made it clearer. You can copy an array by assigning it to another variable.
or in a function:
function arrayExclude($array, Array $excludeKeys){
foreach($excludeKeys as $key){
unset($array[$key]);
}
return $array;
}