为什么不用PHP的自带函数array_count_values 不用自带方法 $tagList = array("Cat", "Dog", "Horse", "Dog"); $count = array(); foreach ($tagList as $tVal) { if (!isset($count[$tVal])) { $count[$tVal] = 1; } else { $count[$tVal]++; } }
为什么不用PHP的自带函数
array_count_values
不用自带方法