2019-05-13-0001PHP 函式

seikai發表於2019-05-13

1、array_change_key_case(array $array [int $case = CASE_LOWER]):array;

Returns an array with all keys from array lowercases or uppercased .Numbered indices are left as is.
-Parameters:
-Array
-The array to work
-case
-Either CASE_UPPER or CASE_LOWER(default)
-Retuen values
-Returns an array with its keys lower or uppercased, or FALSE if array is not an array.
-Errors/Exceptions
-Throws E_WARNING if array is not an array.
-Examples
-Example #1array_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
)

相關文章