valid(); $dir->next()) {
if ($dir->isDir() && !$dir->isDot()) {
if ($dir->haschildren()) {
$files = array_merge($files, get_files($dir->getChildren()));
};
}else if($dir->isFile()){
$files[] = $dir->getPathName();
}
}
return $files;
}
//如果页数不存在或者小于1
if((!isset($page)) || ($page <= 1)) {
$page = 1;
$i = 0;
$num = 15;
}
if($page > 1) {
$i = ($page - 1) * 15;
$num = $i + 15;
}
$path = $mydir.'/'.$time;
$dir = new RecursiveDirectoryIterator($path);
$fname = get_files($dir);
$allnum = count($fname) - 1; //文件总数
//echo $allnum;
//最大页数
$allpage = round($allnum / 15,0);
$uppage = $page - 1; //上一页
$downpage = $page + 1; //下一页
$downpage = ($page >= $allpage) ? $page : $downpage;
//echo $allpage;
//如果文件数小于15
//$num = count($allnum < 15) ? $allnum : $num;
if($allnum <= 15) {
$num = $allnum;
}
for($i;$i <= $num;$i++) {
$fname[$i] = str_replace("\\","/",$fname[$i]);
//如果文件是空的,则终止循环
?>
"."$fname[$i]";
?>
|
删除";
}
?>
|
上一页
下一页