php 界面搜索框搜索指定目录的文本,如何不使用数据库进行搜索?
1
loading Nov 15, 2016 via Android
文本不大就 file open 到内存
文本大就调用 linux 命令 |
2
barbery Nov 15, 2016
glob
|
3
m939594960 Nov 15, 2016
https://stackoverflow.com/questions/14301895/finding-files-with-a-certain-string 这个回答
··· $searchDir = './'; $searchString = 'a test'; $result = shell_exec('grep -Ri "'.$searchString.'" '.$searchDir); echo '<pre>'.$result.'</pre>'; ··· |
4
alex321 Nov 15, 2016
shell_exec
|
5
vibbow Nov 15, 2016
https://gist.github.com/vibbow/a56d54fa08bb66501f852b6dfd2e9d49
5 年前写的代码, LZ 可以试着理解一下...... 基本上可以以磁盘极限速度搜索。 |