DirectoryIterator 文件目录迭代器
最后更新于:2022-04-02 02:26:38
[TOC]
## 接口
## 实例
```
// 目录为
//Runtime
// ├── Cache
// ├── Cmd
// │ ├── cmd-2020-07-17.txt
// ├── Data
// ├── Logs
// └── Temp
$directoryIterator = new DirectoryIterator('Runtime');
foreach ($directoryIterator as $fileInfo) {
if($fileInfo->isDot()) {
continue;
}
echo $fileInfo->getFilename() . "\n"; // Cache
echo $fileInfo->getPathname() . "\n"; // Runtime\Cache
echo $fileInfo->getRealPath() . "\n"; // D:\Program Files (x86)\IM Console\IM Console\im_webserver\ant_universal_10\Runtime\Cache
}
```
';