public static function changeKeyCase(array $input, int $case = self::CASE_LOWER) : array
    {
        if ($case & self::CASE_UNDERSCORE) {
            $input = self::underscoreKeys($input);
        }

        if ($case & self::CASE_CAMEL_CAPS) {
            $input = self::camelCaseKeys($input);
        }

        if ($case & self::CASE_UPPER) {
            $input = array_change_key_case($input, \CASE_UPPER);
        }

        if ($case & self::CASE_LOWER) {
            $input = array_change_key_case($input, \CASE_LOWER);
        }

        return $input;
    }
public static function changeKeyCase(array $input, int $case = self::CASE_LOWER) : array
    {
        if ($case & self::CASE_UNDERSCORE) {
            $input = self::underscoreKeys($input);
        }

        if ($case & self::CASE_CAMEL_CAPS) {
            $input = self::camelCaseKeys($input);
        }

        if ($case & self::CASE_UPPER) {
            $input = array_change_key_case($input, \CASE_UPPER);
        }

        if ($case & self::CASE_LOWER) {
            $input = array_change_key_case($input, \CASE_LOWER);
        }

        return $input;
    }
public static function changeKeyCase ( array $ input , int $ case = self :: CASE_LOWER ) : array { if ( $ case & self :: CASE_UNDERSCORE ) { $ input = self :: underscoreKeys ( $ input ) ; } if ( $ case & self :: CASE_CAMEL_CAPS ) { $ input = self :: camelCaseKeys ( $ input ) ; } if ( $ case & self :: CASE_UPPER ) { $ input = array_change_key_case ( $ input , \ CASE_UPPER ) ; } if ( $ case & self :: CASE_LOWER ) { $ input = array_change_key_case ( $ input , \ CASE_LOWER ) ; } return $ input ; }
Changes the case of all keys in an array. Numbered indices are left as is.

@param array   $input The array to work on.
@param integer $case  The case to which the keys should be set.

@return array Returns an array with its keys case changed.
Changes the case of all keys in an array . Numbered indices are left as is .