PHP Search File program sharing,
For the local, we can take advantage of the Windows own find to find out, but for the online, such as the search FTP space inside the file, this program is very useful.
PHP file Finder Source:
<title>PHP Version File Search</title> <?php/* * Note: case sensitive * by:http://www.daixiaorui.com */if (!empty ($_post[' path ') &&!empty ($_post[' key ')) { echo "in Path". $_post[' path ']. " /in Find ". $_post[' key ')." The result is:
"; $file _num = $dir _num = 0; $r _file_num = $r _dir_num= 0; $findFile = $_post[' key ']; function Deldirandfile ($dirName) {if ($handle = @opendir ("$dirName")) {while (false!== ($item = Readdir ($hand Le)) {if ($item! = "." && $item! = "...") {if (Is_dir ("$dirName/$item")) {Deldirandfile ("$dirName/$item"); } else {$GLOBALS [' file_num ']++; if (Strstr ($item, $GLOBALS [' FindFile '])) {echo "$dirName/$item
\ n "; $GLOBALS [' R_file_num ']++; }}}} Closedir ($handle); $GLOBALS [' Dir_num ']++; if (Strstr ($dirName, $GLOBALS [' FindFile '])) {$loop = explode ($GLOBALS [' FindFile '], $dirName); $COUNTARR = count ($loop)-1; if (Empty ($loop [$COUNTARR])) {echo '$dirName
\ n "; $GLOBALS [' R_dir_num ']++; }}}else{die ("No This path! "); } } Deldirandfile ($_post[' path '); echo "
A total of ". $file _num." Files, folders ". $dir _num." A
"; echo "
A total of ". $r _file_num." Files, folders ". $r _dir_num." A
";}? >
The above is the PHP file Finder program, you can search for local files, easy to operate, I hope that everyone's learning is helpful.
http://www.bkjia.com/PHPjc/1066502.html www.bkjia.com true http://www.bkjia.com/PHPjc/1066502.html techarticle PHP Search File program sharing, for the local, we can use the windows to find to go to find, but for the online words, such as the search FTP space inside the file, this program is very ...