您好,欢迎访问一九零五行业门户网

PHP读取文本文件并逐行输出该行使用最多的字符串及对应次数

$myfile = fopen("test.txt", "r"); while(!feof($myfile)) { $line_str = fgets($myfile); $str_arr = count_chars($line_str, 1); arsort($str_arr); print_r(chr(key($str_arr)).' is '.current($str_arr).php_eol); } fclose($myfile);
其它类似信息

推荐信息