The
array_change_key_case() PHP array function will change all keys in an array to either uppercase or lowercase. It can take one or two parameters. The first parameter we feed this function is the target array. The second parameter allows you to specify either CASE_LOWER or CASE_UPPER. If you do not specify a second parameter this function will default to using CASE_LOWER to change the case of all keys in the array.

<?php
$myCarInfo = array("mAkE" => "Jeep", "mOdEl" => "Liberty", "yEaR" => "2005");
$myCarInfo = array_change_key_case($myCarInfo, CASE_LOWER);
foreach ($myCarInfo as $key => $value) {
echo "$key | $value <br />";
}
?>
make | Jeep
model | Liberty
year | 2005