Home › Forums › Back End › How to make array key lowercase? › Re: How to make array key lowercase?
March 30, 2013 at 6:45 am
#130204
CrocoDillon
Participant
Old post but you don’t even need to copy the array
function array_change_key_case_recursive($input, $case = null) {
$case = $case ?: CASE_LOWER;
$input = array_change_key_case($input, $case);
foreach ($input as $key => $val) {
if (is_array($val))
$input[$key] = array_change_key_case_recursive($val, $case);
}
}