Scan Directories
Author: Abdulrehman Sheikh
Language: PHP 7.0
Email: sheikhabdulrehman8@gmail.com
Author URL: https://pk.linkedin.com/in/abdulrehman-sheikh-a08695a7
Stack Overflow: https://stackoverflow.com/users/9617649/abdulrehman-sheikh
Description:
This code will scan all your directory, sub directory and files inside your given location.
You can perform any action you want to do with any type of junk files. Actually this idea came to my mind when I have 5 folders containing thousands of folders having few .html , .mp4 and few junk files but I required only .html and mp4 files. I had to delete all junk files to save my occupied space.
Then I wrote this script which can scan all the directories and sub directories. It will delete all the junk files and only mp4 and html will be left to copy!
How To Use?
Download the index.php file and put it in your localhost xampp, wamp, ammps or any server you are using for running PHP.
For XAMPP Users
Goto htdocs, create a folder lets suppose htdocs/scanner. Put the file index.php inside scanner folder. Create another folder inside htdocs/scanner/ named my_directory and put different files and sub directories inside that htdocs/scanner/my_directories. Now open index.php and replace scan_directory("PATH_TO_YOUR_DIRECTORY"); with scan_directory("my_directory"); in the bottom of the code. Now run the code by using link i.e http://localhost/scanner/ you will see your all junk files will be removed and only mp4 and html files will be left.Thank You,
Regards
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。
3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考学习用!
4、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。