object reference
From Wiki
I used this for uinnttesg specific values from an array./* unset array items by value via recursive lambda function */// unset every occurrence of single value$unsetThisValues = 4;// or unset every occurrences of multiple values$unsetThisValues = array 4, 5 ; $inputArray = array 3, 4, 5, array 1, 2, array 8, 7, 6, 5, 4, 3 , 3, 4, 5 , 6 ; $outputArray = array_filter $inputArray, $recursiveUnsetCallback = function $arrayValue use $recursiveUnsetCallback, $unsetThisValues if is_array $arrayValue $arrayValue = array_filter $arrayValue, $recursiveUnsetCallback ;return !empty $arrayValue ; $unsetThisValues = array $unsetThisValues;return !in_array $arrayValue, $unsetThisValues ; ; var_dump $outputArray ;