helpers/ArrayHelper.php
public static function removeValue(&$array, $key, $default = null)
    {
        if (is_array($array)) {
            $value = static::getValue($array, $key, $default);
            unset($array[$key]);
            return static::value($value);
        }
        return self::value($default);
    }
public static function removeValue(&$array, $key, $default = null)
    {
        if (is_array($array)) {
            $value = static::getValue($array, $key, $default);
            unset($array[$key]);
            return static::value($value);
        }
        return self::value($default);
    }
public static function removeValue ( & $ array , $ key , $ default = null ) { if ( is_array ( $ array ) ) { $ value = static :: getValue ( $ array , $ key , $ default ) ; unset ( $ array [ $ key ] ) ; return static :: value ( $ value ) ; } return self :: value ( $ default ) ; }
Removes an item from the given options and returns the value.

If no key is found, then default value will be returned.

@param $array
@param $key
@param null $default
@return mixed|null
Removes an item from the given options and returns the value .