https://static.iklfy.com/static/images/index/16.jpg

php目录遍历

    /**
     * 遍历路径下文件存为数组
     * @param  String $path 要遍历文件的路径
     * @return Array  返回存入全局作用域中的数组
     */
    function traverse($path='.'){
        static $files_list = array();
        foreach ($files = array_diff(scandir($path),array('.','..')) as $file) {
            $filename = $path.'/'.$file;
            if (is_dir($filename)) {
                traverse($filename);
            }else{
                $files_list[] = $f