PHP array_change_key_case function

Syntax of array_change_key_case function

array array_change_key_case(array array[, CASE_UPPER|CASE_LOWER])

Returns an array whose elements’ keys are changed to all uppercase or all lowercase. Numeric indices are unchanged. If the optional case parameter is left off, the keys are changed to lowercase

Example of array_change_key_case

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


    [FIRST] => 1
    [SECOND] => 4

Leave a Comment