$arr=str_split($str);$arr=array_count_values($arr);arsort($arr);print_r($arr);
来源: http://www.phpxs.com/code/1003581/