<?php$path = ‘./use‘;$result = scanFile($path);function scanFile($path) { ?global $result; ?$files = scandir($path); ?foreach ($files as $file) { ???if ($file != ‘.‘ && $file != ‘..‘) { ?????if (is_dir($path . ‘/‘ . $file)) { ???????scanFile($path . ‘/‘ . $file); ?????} else { ???????$result[] = basename($file); ?????} ???} ?} ?return $result;}
php读取目录下的所有文件
原文地址:https://www.cnblogs.com/jjxhp/p/9893129.html