$page = 1;
$total = 20;
$prevs = $page - 4;
if($prevs $prevs = 1;
}
$next = $page + 4;
if($next > $total) {
$next = $total;
}
for($i = $prevs; $i echo $i."\r\n";
}
echo '['.$page.']'."\r\n";
for($i = $page + 1; $i echo $i."\r\n";
}
本文链接http://www.cxybl.com/html/wlbc/Php/20130504/37473.html