PHP Array Functions: array_change_key_case

In this programming tutorial, you will learn how to use the PHP array function array_change_key_case to manipulate array keys in your arrays.

array_change_key_case() function is used to manipulate array keys(string) into UPPERCASE OR LOWERCASE.


array_change_key_case($array, CASE_LOWER or CASE_UPPER);

Here :
$array is the name of the array
The second parameter is manipulated type, means whether you are going to convert the values in the array to upper or lower case(default).

if you omit the second parameter, all keys are converted to lowercase, not numbers(Numbered indices are left as is).

Programming Example:

The About Code take the $name array and change all the keys into lower case.

Converting array keys to upper case is simple one like above example just change the second parameter ,here is the example :

Post By: Arjun

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 vote
Article Rating
Notify of
Inline Feedbacks
View all comments Protection Status
Would love your thoughts, please comment.x