Changes all key case in an array in php
by kalai[ Edit ] 2009-11-07 12:06:17
We can change array key values either to lower or upper case using array_change_key_case() function
<?php
$input_array = array("FirSt" => 1, "SecOnd" => 4);
print_r(array_change_key_case($input_array, CASE_UPPER));
?>
Result:
Array
(
[FIRST] => 1
[SECOND] => 4
)