Home > Article > Backend Development > A brief discussion on php array array_change_key_case() function and array_chunk() function_php examples
is as follows:
'Java', 'B'=>'Php', 'c'=>'C++', 'D'=>'C#'); print_r(array_change_key_case($input_array, CASE_LOWER)); print_r(array_change_key_case($input_array, CASE_UPPER)); //如果在运行该函数时两个或多个键相同,则最后的元素会覆盖其他元素,例如: $input_array = array('a'=>'Barcelona', 'B'=>'Madrid', 'c'=>'Manchester', 'b'=>'Milan'); print_r(array_change_key_case($input_array, CASE_LOWER)); ?>
Running result:
'Java', 'B'=>'Php', 'C'=>'C++', 'D'=>'C#'); print_r(array_chunk($input_array, 2 ,false)); print_r(array_chunk($input_array, 3 ,true)); ?>
Running result:
The above is what the editor brings to you Let’s briefly talk about the PHP array array_change_key_case() function and array_chunk() function. I hope everyone will support Script Home~