当前位置:网站首页>It can traverse all files and subfolders under a folder
It can traverse all files and subfolders under a folder
2022-07-28 09:53:00 【MountainYanYL】
// Use recursion to achieve , About what is recursion , Self search
public static function my_scandir($dir){
$files = array();
if(is_dir($dir)){
if($handle =opendir($dir)){
while (($file = readdir($handle))!== false){
if($file != '.' && $file!='..'){
$_dir = $dir ."/".$file;
if(is_dir($_dir)){
$files[$file] = self::my_scandir($_dir);
}else{
$files[] = $_dir;
}
}
}
closedir($handle);
return $files;
}
}
}
边栏推荐
- Go language slice vs array panic runtime error index out of range problem solving
- Domain events and integration events are not so big
- 3分钟带你了解微信小程序开发
- [log] what does a log do? What is a log factory? Configuration and use of log4j? log4j. Properties file configuration, log4j jar package coordinates
- The high temperature continues, and public transport enterprises carry out special safety training
- EvaluatorFilter简介说明
- 在Plato Farm新经济模型下,如何在游戏中获取更多MARK
- MySQL中各类型文件详解
- 2022-7-27周报
- 多线程一定能优化程序性能吗?
猜你喜欢

Translation recommendation | debugging bookkeeper protocol - unbounded ledger

C countdown tool

C# 倒计时工具

OSS direct upload rails service practice

极致通缩和永动机模型,将推动 PlatoFarm 爆发

Go language slice vs array panic runtime error index out of range problem solving

在Plato Farm新经济模型下,如何在游戏中获取更多MARK

数据不会说谎,Plato Farm就是元宇宙龙头

多线程一定能优化程序性能吗?

The secret behind three salary increases a year
随机推荐
Linux操作系统(Centos7)安装MySQL
能够遍历一个文件夹下的所有文件和子文件夹
分支与循环(1)
Window source code analysis (I): things with decorview
Domain events and integration events are not so big
C# 倒计时工具
数据不会说谎,Plato Farm就是元宇宙龙头
今天和大家聊一聊mysql数据库的数据类型
What is cross domain? How to solve the cross domain problem?
PHP 获取接口的方式
With frequent data leakage and deletion events, how should enterprises build a security defense line?
View事件分发机制源码解析
数据库高级学习笔记--游标
C form application uses object binding DataGridView data binding
The maximum recommended number of rows for MySQL is 2000W. Is it reliable?
Database advanced learning notes -- storage functions
业务可视化-让你的流程图'Run'起来(4.实际业务场景测试)
OSS direct upload rails service practice
With such a simple verification, 80% of programmers can't do it, let alone understand it!
The secret behind three salary increases a year