array_count_values
统计数组中所有的值出现的次数
&reftitle.description;
arrayarray_count_values
arrayinput
array_count_values 返回一个数组,该数组用 input
数组中的值作为键名,该值在 input 数组中出现的次数作为值。
&reftitle.parameters;
input
统计这个数组的值
&reftitle.returnvalues;
返回一个关联数组,用 input
数组中的值作为键名,该值在数组中出现的次数作为值。
&reftitle.errors;
对数组里面的每个不是 string 和 integer 类型的元素抛出一个警告错误(E_WARNING)。
&reftitle.examples;
array_count_values 例子
]]>
&example.outputs;
2
[hello] => 2
[world] => 1
)
]]>
&reftitle.seealso;
count
array_unique
array_values
count_chars