Home >Backend Development >PHP Tutorial >recurse_array_change_key_case() recursively returns an array whose string key names are all lowercase or uppercase_PHP tutorial
//Recursively returns an array whose string keys are all lowercase or uppercase
function recurse_array_change_key_case(&$input, $case = CASE_LOWER){
if(!is_array($input))
return;
foreach($input as $key => $val)
{
//1
if($case == CASE_UPPER)
{
$newkey = strtoupper($key); );
; }
in $key=>&$val
in foreach recurse_array_change_key_case($input[$newkey], $case);
}
}
}
http://www.bkjia.com/PHPjc/752221.html
www.bkjia.com
true
http: //www.bkjia.com/PHPjc/752221.html
TechArticle