<?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; }
原文地址:https://www.cnblogs.com/jjxhp/p/9893129.html
时间: 2024-10-26 16:41:11