array_change_key_case
Changes all keys in an array
&reftitle.description;
arrayarray_change_key_case
arrayinput
intcaseCASE_LOWER
Returns an array with all keys from input lowercased
or uppercased. Numbered indices are left as is.
&reftitle.parameters;
input
The array to work on
case
Either CASE_UPPER or
CASE_LOWER (default)
&reftitle.returnvalues;
Returns an array with its keys lower or uppercased, or &false; if
input is not an array.
&reftitle.errors;
Throws E_WARNING if input is
not an array.
&reftitle.examples;
array_change_key_case example
1, "SecOnd" => 4);
print_r(array_change_key_case($input_array, CASE_UPPER));
?>
]]>
&example.outputs;
1
[SECOND] => 4
)
]]>
&reftitle.notes;
If an array has indices that will be the same once run through this
function (e.g. "keY" and "kEY"),
the value that is later in the array will override other indices.