在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
函数:
function multi($count, $perpage, $currentpage, $url) { //multi pages if ($count > $perpage) { $num = ceil($count / $perpage); $string = "<a href=\"" . BASE_URL . $url . "&page=1\"" . ($currentpage == 1 ? " style=\"font-weight: bold\"" : "") . ">1</a>"; for ($i = 2; $i <= $num; $i++) { $string .= " | <a href=\"" . BASE_URL . $url . "&page=" . $i . "\"" . ($i == $currentpage ? " style=\"font-weight: bold\"" : "") . ">" . $i . "</a>"; } return $string; } else { return ""; } } 调用: //multi page $page = empty($_GET['page']) ? 1 : intval($_GET['page']); $perpage = 3; $start = ($page - 1) * $perpage; $multi = multi($count, $perpage, $page, $pageurl); |
2022-08-19
2022-07-30
2022-08-17
2022-11-06
2022-08-17
请发表评论