久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php分頁代碼簡(jiǎn)單實(shí)現(xiàn)教程

      php分頁代碼簡(jiǎn)單實(shí)現(xiàn)教程

      php分頁代碼簡(jiǎn)單實(shí)現(xiàn)

      1、首先獲取數(shù)據(jù)的總條數(shù);

      2、然后在用總條數(shù)除以每頁的條數(shù),得出的到總頁數(shù);

      //模擬總條數(shù) $total = 84; //每頁的數(shù)量 $count = 10; //計(jì)算頁數(shù) $page = $total / $count;  echo $page;

      輸出結(jié)果:8.4

      3、再將總頁數(shù)使用“ceil()”函數(shù)轉(zhuǎn)為整數(shù),“ceil()”函數(shù)意思就是對(duì)小數(shù)向上取整;

      <?php //模擬總條數(shù) $total = 84; //每頁的數(shù)量 $count = 10; //計(jì)算頁數(shù) $page = $total / $count; //向上取整 $page = ceil($page);  echo $page;

      輸出結(jié)果:9

      4、最后根據(jù)總頁數(shù)渲染翻頁鏈接。

      // 翻頁鏈接   for ($i = 0; $i < $page; $i ++) {       echo "<a href=index.php?page=" . ($i + 1) . ">" . ($i + 1) . "</a>";   }

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)