PHPでディレクトリのファイルをループして一覧する。
foreach (new DirectoryIterator('/path/to/your/dir') as $fileinfo) {
if (!$fileinfo->isDot()) {
$filename = $fileinfo->getFilename();
}
}
More than 5 years have passed since last update.
PHPでディレクトリのファイルをループして一覧する。
foreach (new DirectoryIterator('/path/to/your/dir') as $fileinfo) {
if (!$fileinfo->isDot()) {
$filename = $fileinfo->getFilename();
}
}
Register as a new user and use Qiita more conveniently