blob: 70eb6b387f1afc3e9bfb51a269dfd66743579441 [file] [log] [blame]
maxwen94329062017-02-17 01:29:13 +01001<?php
2
3function 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)) {
maxwen8754f052018-10-21 16:40:43 +020015 $output[$path.'/'.$file] = list_files($path.'/'.$file);
maxwen94329062017-02-17 01:29:13 +010016 } else {
17 $output[] = array("filename"=>$file, "timestamp"=>filemtime($path.'/'.$file));
18 }
19 }
20
21 return $output;
22}
23
24//chdir("../");
25echo json_encode(list_files("."));
26
27
28
29
30?>
31