Filter an array with a callback – for single & multidimensional arrays

While your answer is very interesting and I like it, I still want to post another proposal, just let you have another choice 🙂

IMHO, if the data contains only simple fields, like:

array(
    'name' => 'my name',
    'address' => 'my address',
    'phone' => '01234',
);

then you can use the code below:

add_filter( 'wpse63692_example_filter', 'wpse63692_example_cb' );

function wpse63692_example_cb( $data )
{
    foreach ( $data as $key => $value )
    {
        // Recursively apply filters to sub array
        if ( is_array( $value ) )
            $data[$key] = apply_filters( current_filter(), $value );
    }

    // Do something with $data

    return $data;
}