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);
$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).
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.
I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.