public static function removeNestedKey(array &$array, array $keys, $removeEmptyParents = false)
    {
        $key = array_shift($keys);
        if (count($keys) == 0) {
            unset($array[$key]);
        } elseif (isset($array[$key])) {
            self::removeNestedKey($array[$key], $keys, $removeEmptyParents);
            if ($removeEmptyParents && empty($array[$key])) {
                unset($array[$key]);
            }
        }
    }
public static function removeNestedKey(array &$array, array $keys, $removeEmptyParents = false)
    {
        $key = array_shift($keys);
        if (count($keys) == 0) {
            unset($array[$key]);
        } elseif (isset($array[$key])) {
            self::removeNestedKey($array[$key], $keys, $removeEmptyParents);
            if ($removeEmptyParents && empty($array[$key])) {
                unset($array[$key]);
            }
        }
    }
public static function removeNestedKey ( array & $ array , array $ keys , $ removeEmptyParents = false ) { $ key = array_shift ( $ keys ) ; if ( count ( $ keys ) == 0 ) { unset ( $ array [ $ key ] ) ; } elseif ( isset ( $ array [ $ key ] ) ) { self :: removeNestedKey ( $ array [ $ key ] , $ keys , $ removeEmptyParents ) ; if ( $ removeEmptyParents && empty ( $ array [ $ key ] ) ) { unset ( $ array [ $ key ] ) ; } } }
Removes nested keys in array.

Example:
<code>
$array = array('1' => array('2' => array('3' => 'value')));
Arrays::removeNestedKey($array, array('1', '2'));
</code>
Result:
<code>
Array
(
[1] => Array
(
)
)
</code>

@param array $array
@param array $keys
@param bool $removeEmptyParents
Removes nested keys in array .