47 |
|
} |
48 |
|
|
49 |
|
|
50 |
< |
# return an array of subdirectories in the current directory. |
51 |
< |
function getdirArray($dir='./',$sort='asort') { |
52 |
< |
global $dir_file_count; |
53 |
< |
if ( is_dir($dir) ) { |
54 |
< |
$fd = @opendir($dir); |
55 |
< |
while ( ($part = @readdir($fd)) == TRUE ) { |
56 |
< |
clearstatcache(); |
57 |
< |
if ($part != "." && $part != "..") { |
58 |
< |
if (preg_match("/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/", $part)) { |
59 |
< |
$dir_array[] = $part; |
60 |
< |
} |
61 |
< |
} |
62 |
< |
} |
63 |
< |
if($fd == TRUE) { |
64 |
< |
closedir($fd); |
65 |
< |
} |
66 |
< |
if (is_array($dir_array)) { |
67 |
< |
$sort($dir_array); |
68 |
< |
$dir_file_count = count($dir_array); |
69 |
< |
Return $dir_array; |
70 |
< |
} else { |
71 |
< |
Return FALSE; |
72 |
< |
} |
73 |
< |
} else { |
74 |
< |
Return FALSE; |
75 |
< |
} |
76 |
< |
} |
50 |
> |
include("iutils.inc.php"); |
51 |
|
|
52 |
|
?> |
53 |
|
|