PHP code example of zozor / paginator

1. Go to this page and download the library: Download zozor/paginator 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/ */

    

zozor / paginator example snippets


  declare (strict_types=1);
= 120; // Extract the number of rows from the database
$per_page = 10; // Number of rows displayed on a page
$max_show = 10; // Number max of buttons displayed
$nb_page = (int) ceil($nb_line / $per_page);

$current_page = isset($_GET["current_page"]) ? (int) $_GET["current_page"] : 1;
$current_page = min($nb_page -1, $current_page);
$current_page = max(1, $current_page);

print new Paginator($nb_line, $per_page, $max_show, $current_page);