Tutorials and methods for using PHP array_change_key_case () functions.
Definitions and usage
The Array_change_key_case () function returns the key names of all arrays of an array, lowercase or uppercase.
Grammar
Array_change_key_case (Array,case)
Parameter describes the array required. Optionally, specify an array usage case. Possible value: case_lower-d Eafult value. Returns the lower critical value of the array. Case_upper-Returns the array key value uppercase. Tips and Instructions Note: If two or more array keys will be the same after this function, the last array will be replaced, etc. (see example 2) Example 1 <?php
$a =array ("a" => "Cat", "B" => "Dog", "C" => "horse");
Print_r (Array_change_key_case ($a, case_upper));
?>
Array ([A] => Cat [B] => Dog [C] => horse)
All of the array subscripts are capitalized.
Instance two.
<?php
$a =array ("a" => "Cat", "B" => "Dog", "C" => "Horse", "B" => "Bird");
Print_r (Array_change_key_case ($a, case_upper));
?>
Output results.
Array ([A] => Cat [B] => Bird [C] => horse)