PHP - Function array_change_key_case()
Advertisements
Syntax
array array_change_key_case ( array $input [, int $case] )
Definition and Usage
It returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
Parameters
Sr.No | Parameter & Description |
---|---|
1 |
input The array to work on |
2 |
case Either CASE_UPPER or CASE_LOWER (default) |
Return Values
It returns an array with its keys lower or uppercased, or false if input is not an array.
Example
Try out following example −
Live Demo<?php $input = array("FirSt"=> 10, "SecOnd" => 400); print_r(array_change_key_case($input, CASE_UPPER)); ?>
This will produce following result −
Array ( [FIRST] => 10 [SECOND] => 400 )
php_function_reference.htm
Advertisements