opendir / readdir / closedir 循环输出文件/目录名

最后更新于:2022-04-02 02:30:27

[TOC] ## 示例 ``` // 获取home目录 $home = getenv('HOME'); $opendir = opendir($home); // 输出文件名和目录名 while(($readdir = readdir($opendir))!=false){ echo $readdir.PHP_EOL; } closedir($opendir); ```
';