public static function filter(array $arr, \Closure $predicate){

		$ret = array();

		foreach($arr as $k => $v){
			if($predicate($v, $k)){
				$ret[$k] = $v;
			}
		}

		return $ret;

	}
public static function filter(array $arr, \Closure $predicate){

		$ret = array();

		foreach($arr as $k => $v){
			if($predicate($v, $k)){
				$ret[$k] = $v;
			}
		}

		return $ret;

	}
public static function filter ( array $ arr , \ Closure $ predicate ) { $ ret = array ( ) ; foreach ( $ arr as $ k => $ v ) { if ( $ predicate ( $ v , $ k ) ) { $ ret [ $ k ] = $ v ; } } return $ ret ; }
Traverses an array and generates a new array with the returned values

which pass the predicate function
@param array $arr
@param \Closure $predicate
@return array
Traverses an array and generates a new array with the returned values