php - array_change_key_case

Description

array array_change_key_case ( array $input [, int $case] )

Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.

Parameters


input

The array to work on

case

Either CASE_UPPER or CASE_LOWER (default)

Return Values

Returns an array with its keys lower or uppercased, or false if input is not an array.

Errors/Exceptions

Throws E_WARNING if input is not an array.

Examples

Example 228. array_change_key_case() example

$input_array = array("FirSt" => 1, "SecOnd" => 4);
print_r(array_change_key_case($input_array, CASE_UPPER));

The above example will output:

Array (    
[FIRST] => 1    
[SECOND] => 4
) 

No comments:

Post a Comment