public static function filterArray(array $array, Closure $callback)
    {
        foreach ($array as $index => $collection) {
            $array[$index] = call_user_func($callback, $collection);
        }

        return $array;
    }
public static function filterArray(array $array, Closure $callback)
    {
        foreach ($array as $index => $collection) {
            $array[$index] = call_user_func($callback, $collection);
        }

        return $array;
    }
public static function filterArray ( array $ array , Closure $ callback ) { foreach ( $ array as $ index => $ collection ) { $ array [ $ index ] = call_user_func ( $ callback , $ collection ) ; } return $ array ; }
Filters an array applying a callback function

@param array $array Target array
@param \Closure A callback function that returns a filtered array
@return array
Filters an array applying a callback function