Php file search program sharing, _ PHP Tutorial

Source: Internet
Author: User
Php search file program sharing ,. Php searches for file programs for sharing. for local files, we can use the search provided by windows to find files, but for online files, such as files in the ftp space, this program is very popular with php file search programs to share,

For local systems, we can use the search provided by windows for search. However, for online systems, such as searching for files in the ftp space, this program is very useful.

Php file finder source code:

  
  File search for php)    <? Php/** Note: Case sensitive ** by: http://www.daixiaorui.com */if (! Empty ($ _ POST ['path']) &! Empty ($ _ POST ['key']) {echo "in path ". $ _ POST ['path']. "/in Search ". $ _ 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 (" This path is not available! ") ;}} DelDirAndFile ($ _ POST ['path']); echo" ". $ File_num." files, folders ". $ dir_num." are found in this query.
"; Echo" A total of ". $ r_file_num." files and folders ". $ r_dir_num." matching results
";}?>

The above is the php file finder program. you can search for local files for easy operations and hope it will be helpful for your learning.

Login, for local, we can use the windows built-in search to find, but for online, such as finding files in the ftp space, 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.