时间:2021-07-01 10:21:17 帮助过:21人阅读
#*********************************************************
#分页函数
#*********************************************************
function yl_list_page($pageurl,$rsnum,$pages,$pagecount,$pagesize){
#url
#总记录
#总页数
#当前页码
#每页显示数
//$pageurl='?';
$pcount = $pages;
$page_info = '';
$page_info .= '';
if (($pcount > 1) && ($pcount == $pagecount) ){
$page_info .= '上一页';
}elseif (($pagecount != 1) && ($pcount != $pagecount)){
$page_info .= '上一页';
}
$page_info .= '页首';
if ($pagecount > 4){
$page_info .= '[1]...';
}
if ($pcount > $pagecount+2){
$endpage = $pagecount+2;
}else{
$endpage = $pcount;
}
for ($n = ($pagecount-2); $n <= $endpage; $n++){
if (!($n < 1)){
if ($n == intval($pagecount)){
$page_info .= ''.$n.'';
}else{
$page_info .= '['.$n.']';
}
}
}
if ($pagecount+2 < $pcount){
$page_info .= '...['.$pcount.']';
}
$page_info .= '页尾';
if (($pagecount == 1) && ($pcount != $pagecount) && ($pcount != 0)){
$page_info .= '下一页';
}else if (($pagecount != 1) && ($pcount != $pagecount)){
$page_info .= '下一页';
}
$page_info .= '';
$page_info .= '';
$page_info .= ' 共:'.$rsnum .'条/'.$pcount.'页 每页/'.$pagesize.'条';
$page_info .= ' ';
//echo '';
$page_info .= '';
$page_info .= '';
return $page_info;
}
以上就介绍了PHP经典分页导航函数,包括了PHP分页导航方面的内容,希望对PHP教程有兴趣的朋友有所帮助。