开发者

php pagination with break or continue

开发者 https://www.devze.com 2023-01-27 08:56 出处:网络
I need to make a paging with this format: 1 2 3 4 5 ... 205 i use now this for loop: $nav = \'\'; for($pageNum = 1; $pageNum <= $maxPage; $pageNum++)

I need to make a paging with this format:

1 2 3 4 5 ... 205

i use now this for loop:

$nav = '';
for($pageNum = 1; $pageNum <= $maxPage; $pageNum++)
{
   if 开发者_运维百科($pageNum == $p)
   {
   $nav .= '<li class=\"current\">$pageNum</li>';
   }
   else
   {
   $nav .= '<li><a href=\"?page=".$pageNum."\">$pageNum</a></li>';
   }
}

i need to use a php break or continue??


Here there ara an example http://www.programacion.com/articulo/paginar_los_resultados_de_una_consulta_en_php_149

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号