Merge some child values back into the parent multidimensional array
What's the criteria for deciding which keys to keep?

Check out the array_walk_recursive() function. For example, the following matches any element with a key that starts with "nice_value".

$array = /*your array example*/;
$filtered = array();
array_walk_recursive($array, function($val, $key) use(&amp;$filtered) {
    if (strpos($key, 'nice_value') === 0) {
        $filtered[$key] = $val;
    }
});