PHP列出当前目录所有文件

点击查看代码
if ($handle = opendir('.')) {
    while (false !== ($entry = readdir($handle))) {
        if ($entry != '.' && $entry != '..') {
            echo "$entry\n";
        }
    }
    closedir($handle);
}
posted @ 2024-06-12 15:42  php冉  阅读(10)  评论(0)    收藏  举报