foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator('.')) as $filename) { // filter out "." and ".." if ($filename->isDir()) continue; echo "$filename "; }
PHP documentation:
2.1m questions
2.1m answers
60 comments
57.0k users