时间:2020-12-09 20:22:12 | 栏目:PHP代码 | 点击:次
if($array){
rsort($array);//修改日期倒序排序
}
for($j=$imgnums*$page; $j<($imgnums*$page+$imgnums)&&$j<$i; ++$j){
echo '<div>';
echo $array[$j],'<br />';
echo "<img src=".$path."/".$array[$j]."><br />";
echo '</div>';
}
$realpage = @ceil($i / $imgnums) - 1;
$Prepage = $page-1;
$Nextpage = $page+1;
if($Prepage<0){
echo "上一页 ";
echo "<a href=?page=$Nextpage>下一页</a> ";
echo "<a href=?page=$realpage>最末页</a> ";
}elseif($Nextpage >= $realpage){
echo "<a href=?page=0>首页</a> ";
echo " <a href=?page=$Prepage>上一页</a> ";
echo " 下一页";
}else{
echo "<a href=?page=0>首页</a> ";
echo "<a href=?page=$Prepage>上一页</a> ";
echo "<a href=?page=$Nextpage>下一页</a> ";
echo "<a href=?page=$realpage>最末页</a> ";
}
?>
</div>