Home > php教程 > php手册 > array_change_key_case:返回字符串键名全为大写或小写的数组

array_change_key_case:返回字符串键名全为大写或小写的数组

WBOY
Release: 2016-06-06 19:39:24
Original
1060 people have browsed it

array_change_key_case(array$input[,int$case=CASE_LOWER]) 将input数组中的所有键名改为全小写或大写。改变是根据后一个选项case参数来判断的 $arr1 = ['abc'='ccc','Abcd'='bbb'];$arr = array_change_key_case($arr1,CASE_UPPER);echo 'pre';print_r($ar

array_change_key_case ( array $input [, int $case = CASE_LOWER ] )
将 input 数组中的所有键名改为全小写或大写。改变是根据后一个选项 case 参数来判断的

$arr1 = ['abc'=>'ccc','Abcd'=>'bbb'];
$arr = array_change_key_case($arr1,CASE_UPPER);

echo '<pre class="brush:php;toolbar:false">';
print_r($arr);

result:
Array
(
    [ABC] => ccc
    [ABCD] => bbb
)
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template