|
|
array_change_key_case - PHP
|
Views : 204
|
|
Tagged in : PHP
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
array_change_key_case â Changes all keys in an array
Description
array array_change_key_case ( array $input [, int $case = CASE_LOWER ] )
Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
Parameters
input
The array to work on
case
Either CASE_UPPER or CASE_LOWER (default)
Return Values
Returns an array with its keys lower or uppercased, or FALSE if input is not an array.
Errors/Exceptions
Throws E_WARNING if input is not an array.
Examples
Example #1 array_change_key_case() example
<?php
$input_array = array("FirSt" => 1, "SecOnd" => 4);
print_r(array_change_key_case($input_array, CASE_UPPER));
?>
The above example will output:
Array
(
[FIRST] => 1
[SECOND] => 4
)
|
|
By gowtham, On - 2010-09-17 |
|
|
|