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.
Use effect:
PHP file Finder Source:
Copy the Code code as follows:
PHP Version File Search
/*
* Note: Case sensitive
* By:http://www.php.net
*/
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 ($handle))) {
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
";
}
?>