1if ($handle = opendir('.')) {
2
3 while (false !== ($entry = readdir($handle))) {
4
5 if ($entry != "." && $entry != "..") {
6
7 echo "$entry\n";
8 }
9 }
10
11 closedir($handle);
12}
1scandir ( string $directory [, int $sorting_order = SCANDIR_SORT_ASCENDING [, resource $context ]] ) : array