我想计算每个数字出现在阵列中的次数.
数字都在1到10之间
例如:{1,2,2,5,5,6,7,8,2)将为'2'返回3个实例.其余为2个"5"实例和1个实例.
最好的方法是什么,除了我创建10 for循环?
php arrays search
arrays ×1
php ×1
search ×1