-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.php
More file actions
executable file
·50 lines (33 loc) · 954 Bytes
/
list.php
File metadata and controls
executable file
·50 lines (33 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
function timesort($a, $b) {
return $a[1] < $b[1];
}
function getDirectoryList ($directory)
{
// create an array to hold directory list
$results = array();
// create a handler for the directory
$handler = opendir($directory);
// open directory and walk through the filenames
while ($file = readdir($handler)) {
// if file isn't this directory or its parent, add it to the results
if(substr($file,0,1) != ".") {
if (substr($file,0,1) != ".") {
$testfile = "cache/" . $file . "/" . "31.jpg";
if (file_exists($testfile)) {
$results[] = array($file, filemtime("cache/" . $file));
}
}
}
}
// tidy up: close the handler
closedir($handler);
// done!
return $results;
}
$l = getDirectoryList("cache");
usort($l, timesort);
for ($i = 0; $i < count($l); $i++) {
print $l[$i][0] . "\n";
}
?>