object reference

From Wiki

JSOM

Revision as of 18:50, 29 February 2012 by 198.86.245.101 (talk) (dmBAmKLcbn)
Jump to: navigation, search

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 ;