function page ( $totalPage , $currentPage,$url ,$halfPer=5)
{
$total=$totalPage-1;
$re="
0&&page跳转/n";$re .= ( $currentPage > 0 )
? "
首页/n 上一页/n": "
首页/n上一页/n";for ( $i = $currentPage - $halfPer,$i > 0 || $i = 0 , $j = $currentPage + $halfPer, $j < $totalPage || $j = $totalPage;$i < $j ;$i++ )
{
$re .= $i == $currentPage
? "
[" . ( $i + 1 ) . "]/n": "
" . ( $i + 1 ) . "/n";}
$re .= ( $currentPage < $total )
? "
下一页/n 尾页/n": "
下一页/n尾页/n";$re="
";return $re;
}
?>