How to change array keys from uppercase to lowercase in php

In this tutorial we are going to see, how to change array keys from uppercase to lowercase.

array_change_key_case() predefined php function will be used to changes all keys in array to lowercase or uppercase.

Method Syntax : array_change_key_case(array,case);

First Parameter : array
Second parameter : It is optional,you can pass either CASE_LOWER or CASE_UPPER and default value is “CASE_LOWER”.

Example : array_change_key_case() function in PHP.

Output will be

I hope you like this Post, Please feel free to comment below.Happy Coding…

Add a Comment

Your email address will not be published. Required fields are marked *