尝试这个:
function removeElementWithValue($array, $key, $value){
foreach($array as $subKey => $subArray){
if($subArray[$key] == $value){
unset($array[$subKey]);
}
}
return $array;
}
然后,您将这样称呼它:
$array = removeElementWithValue($array, "year", 2011);