当前位置:网站首页>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;
}
}
}
边栏推荐
猜你喜欢

The high temperature continues, and public transport enterprises carry out special safety training

Use xposed to crack the software
Edge团队详解如何通过磁盘缓存压缩技术提升综合性能体验

Pulse style | exclusive interview with Committee -- Tencent engineer Zhang Dawei calls you to eat "crab"

IDC script file running

Have you ever seen this kind of dynamic programming -- the stock problem of state machine dynamic programming (Part 2)

What is cross domain? How to solve the cross domain problem?

超级原始人系列盲盒即将上线,PlatoFarm赋能超多权益

Net 3 lines of code to realize the function of text to speech

SQL server, MySQL master-slave construction, EF core read-write separation code implementation
随机推荐
领域事件和集成事件没那么高大上
备受关注的Bit.Store,最新动态一览
ConsoleAppender简介说明
Seeing clearly is more important than walking fast, because you can go far only when you walk right
C countdown tool
Learn a hammer.Net zero foundation reverse tutorial lesson 3 (shell and homework)
实验五:用户与用户组管理
Plato Farm-以柏拉图为目标的农场元宇宙游戏
Inside database system distributed system
Common tool functions are constantly updated
Introduction to SD card (based on spec3.0)
Deepin 下安装 LAMP
Go language slice vs array panic runtime error index out of range problem solving
数据库高级学习笔记--存储结构
Window source code analysis (III): window update mechanism
Edge团队详解如何通过磁盘缓存压缩技术提升综合性能体验
总线相关概念集合
Pulse style | exclusive interview with Committee -- Tencent engineer Zhang Dawei calls you to eat "crab"
NET 3行代码实现文字转语音功能
Real time editor of MATLAB