<?php
$array = array(1,'hello',1,'world','hello');
print_r(array_count_values($array));
输出:
Array
(
[1] => 2
[hello] => 2
[world] => 1
)
<?php
$array = array(1,'hello',1,'world','hello');
print_r(array_count_values($array));
Array
(
[1] => 2
[hello] => 2
[world] => 1
)