maxwen | 9432906 | 2017-02-17 01:29:13 +0100 | [diff] [blame] | 1 | <?php |
| 2 | |
| 3 | function list_files($path) { |
| 4 | $output = array(); |
| 5 | $files = scandir($path); |
| 6 | if ($path == "./_h5ai" || $path == "./.bak") return $output; |
| 7 | |
| 8 | foreach ($files as $file) { |
| 9 | if ($file == "." || $file == ".." || strpos($file, '.html') |
| 10 | || $file == ".bak" || $file == "_h5ai") { |
| 11 | continue; |
| 12 | } |
| 13 | |
| 14 | if (is_dir($path.'/'.$file)) { |
| 15 | } else { |
| 16 | $output[] = array("filename"=>$file, "timestamp"=>filemtime($path.'/'.$file)); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | return $output; |
| 21 | } |
| 22 | |
| 23 | //chdir("../"); |
| 24 | echo json_encode(list_files(".")); |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | ?> |
| 30 | |