For local, we can use Windows with the lookup to find, but for online, such as looking for FTP space inside the file, this program is very useful.
Use effect:
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>php Version File Search </title>
<body>
<form action= "" method= "POST" >
<p> File Lookup (note: case sensitive) </p>
<p> path: <input type= "text" name= "path"/></p>
<p> find: <input type= "text" name= "key"/></p>
<p><input type= "Submit" Name= "sub" value= "Start"/></p>
</form>
</body>
<?php
/*
* Note: Case sensitive
* By:http://www.jb51.net
*/
if (!empty ($_post[' path ')) &&!empty ($_post[' key ')) {
echo "in Path". $_post[' path '. " /In Lookup ". $_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 "<span><b> $dirName/$item </b></span><br/>\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 "<span style= ' color: #297C79; ' ><b> $dirName </b></span><br/>\n ";
$GLOBALS [' R_dir_num ']++;
}
}
}else{
Die ("No such path!") ");
}
}
Deldirandfile ($_post[' path '));
echo "echo "}
?>