PHP array_change_key_case() Function

The array_change_key_case() function returns an array with all the keys converted from the lower or upper case. It returns FALSE if it is not an array.

Syntax

array_change_key_case(array $array, int $case = CASE_LOWER)

Parameters:

  1. array (mandatory): The first parameter is an array whose keys are subject to change to lower or upper.
  2. convert_case (optional): It is an optional parameter that takes  CASE_UPPER or CASE_LOWER, the case in which you want to convert. The parameter's default value is CASE_LOWER, in case no value is passed.

Return Type: The function returns an array with lower or upper case keys.