PHP array_change_key_case() function

P
PHP Array Function
PHP array_chunk() function

What is the array_change_key_case function in PHP?

array_change_key_case() function simply converts all keys of an associative array into uppercase.

What is the syntax of the array_change_key_case function in PHP?

array_change_key_case(array, case)
ParameterDetails
arrayConvert the keys of this array into parameters.
caseThere are two cases:
– CASE UPPER
– CASE LOWER

Example of array_array_change_key_case function?

<?php
$age=array("Peter"=>"35","Ben"=>"37","Joe"=>"43");
print_r(array_change_key_case($age,CASE_LOWER));
?>
PHP Array Function
PHP array_chunk() function

Add comment

Tutor Network

Share this

Learn PHP from A to Z