function count_arr_item($arr){
$__arr = array();
if(!empty($arr)&&is_array($arr)){
foreach($arr as $k=>$v){
if( !$__arr[$v] )$__arr[$v]=1;
else $__arr[$v]+=1;
}
}
return $__arr;
}
$arr=array('测试','数据','php','字段','数据','php','你好','数据','sql','演示');
print_r(count_arr_item($arr));
?>
array_count_values