Mercurial > dirlist-php
diff index.php @ 27:aa3f0003fb41
Hide dotfiles.
author | edogawaconan <me@myconan.net> |
---|---|
date | Thu, 30 Oct 2014 12:05:35 +0900 |
parents | eee7ca924a5e |
children | ce92f4d41714 |
line wrap: on
line diff
--- a/index.php Thu Oct 30 12:01:43 2014 +0900 +++ b/index.php Thu Oct 30 12:05:35 2014 +0900 @@ -28,7 +28,7 @@ $files = array(); $dirs = array(); while (($file = readdir($dir_handle)) !== false) { - if ($file === "." || $file === "..") { continue; } + if (substr($file, 0, 1) === ".") { continue; } elseif (is_dir($dir . $file)) { $dirs[] = $file; } else { $files[] = $file; } }