仅就代码而言,可以缩减一点 $file_path = 'd:\work\workplace\test\file\system.log'; $file = fopen($file_path, 'r'); $key = md5(0); $i = 1; while ($buff = fgets($file)) { if ($buff == $key . "\r\n") { echo "find 0 at Line {$i}\r\n"; } $i ++; } fclose($file);
如果一次读取的多一点(比如1M)可能要快一点。不过算法要复杂些
------解决方案-------------------- 做这种东西,不是php的长项
要不搞WEB的话,还是换其它程序搞吧。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn