无论大小写敏感,计算数组值的最简单方法是什么?
试图
$arr=array("A","B","b","A","b", "a", "A");
print_r(array_count_values($arr));
或者:
$arr=array("AliCE","Alice","bob","AlICE","BOB", "aLIce", "alice");
print_r(array_count_values($arr));
演示
电流输出
Array
(
[A] => 3
[B] => 1
[b] => 2
[a] => 1
)
期望输出
Array
(
[A] => 4
[B] => 2
)
或者:
Array
(
[a] => 4
[b] => 2
)
PIPIONE
动漫人物
慕盖茨4494581