src/Northern/Common/Util/ArrayUtil.php
public static function map($callbacks, $arr, $keys = null)
    {
        foreach ($arr as $key => $val) {
            if (is_array($val)) {
                $arr[ $key ] = static::map($callbacks, $arr[ $key ]);
            } elseif (! is_array($keys) or in_array($key, $keys)) {
                if (is_array($callbacks)) {
                    foreach ($callbacks as $callback) {
                        $arr[ $key ] = call_user_func($callback, $arr[ $key ]);
                    }
                } else {
                    $arr[ $key ] = call_user_func($callbacks, $arr[ $key ]);
                }
            }
        }

        return $arr;
    }
public static function map($callbacks, $arr, $keys = null)
    {
        foreach ($arr as $key => $val) {
            if (is_array($val)) {
                $arr[ $key ] = static::map($callbacks, $arr[ $key ]);
            } elseif (! is_array($keys) or in_array($key, $keys)) {
                if (is_array($callbacks)) {
                    foreach ($callbacks as $callback) {
                        $arr[ $key ] = call_user_func($callback, $arr[ $key ]);
                    }
                } else {
                    $arr[ $key ] = call_user_func($callbacks, $arr[ $key ]);
                }
            }
        }

        return $arr;
    }
public static function map ( $ callbacks , $ arr , $ keys = null ) { foreach ( $ arr as $ key => $ val ) { if ( is_array ( $ val ) ) { $ arr [ $ key ] = static :: map ( $ callbacks , $ arr [ $ key ] ) ; } elseif ( ! is_array ( $ keys ) or in_array ( $ key , $ keys ) ) { if ( is_array ( $ callbacks ) ) { foreach ( $ callbacks as $ callback ) { $ arr [ $ key ] = call_user_func ( $ callback , $ arr [ $ key ] ) ; } } else { $ arr [ $ key ] = call_user_func ( $ callbacks , $ arr [ $ key ] ) ; } } } return $ arr ; }
Recursive version of array_map, applies one or more callbacks to all
elements in an array, including sub-arrays.

Apply "strip_tags" to every element in the array
$array = ArrayHelper::map('strip_tags', $array);

Apply $this->filter to every element in the array
$array = ArrayHelper::map(array(array($this,'filter')), $array);

Apply strip_tags and $this->filter to every element
$array = ArrayHelper::map(array('strip_tags',array($this,'filter')), $array);

@param  mixed $callbacks
@param  array $array
@param  mixed $keys
@return array
Recursive version of array_map applies one or more callbacks to all elements in an array including sub - arrays .