PHP code example of heropoo / pagination

1. Go to this page and download the library: Download heropoo/pagination library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

heropoo / pagination example snippets


$user_total = 100;
$page_size = 10;
$page = new Page($user_total, $page_size);
//获取分页 offset 参数
$limit = $page->getLimit();   //等于 $page_size
$offset = $page->getOffset();
//输出的html
$html = $page->getHtml();
echo $html;