Blogger Information
Blog 21
fans 0
comment 0
visits 21105
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php读取当前目录及其子目录
星辰大海
Original
1106 people have browsed it
public function getDir($path,$data = []){
    if (!is_dir($path)) {
        return $data;
    }
    $files = scandir($path);
    foreach ($files as $file) {
        if ($file != '.' && $file != '..') {
            if (is_dir($path.'/'.$file)) {
                $data[$file] = [];
                $data[$file] = $this->getDir($path.'/'.$file,$data[$file]);
            } else {
                $data[] = $file;
            }
        }
    }
    return $data;
}


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post