scandir 返回指定路径的目录和文件
最后更新于:2022-04-02 02:30:19
[TOC]
## 示例
```
$files = scandir('.', SCANDIR_SORT_DESCENDING);
print_r($files);
//Array
//(
// [0] => phpinfo.php.old
// [1] => php_err.log
// [2] => php.log
// [3] => index.php
// [4] => a.php
// [5] => ..
// [6] => .
//)
$files = scandir('.', SCANDIR_SORT_ASCENDING);
print_r($files);
//Array
//(
// [0] => .
// [1] => ..
// [2] => a.php
// [3] => index.php
// [4] => php.log
// [5] => php_err.log
// [6] => phpinfo.php.old
//)
```
';