1// Shows us all files and directories in directory except "." and "..".
2
3foreach (new DirectoryIterator('../moodle') as $fileInfo) {
4 if($fileInfo->isDot()) continue;
5 echo $fileInfo->getFilename() . "<br>\n";
6}
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}