Home > php教程 > php手册 > body text

如何分页设置页码:php 循环分页的页码数

WBOY
Release: 2016-06-21 08:50:03
Original
1782 people have browsed it

$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



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!