PHP Search File program sharing, _php tutorial

Source: Internet
Author: User

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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.