Pagination Function PHP example
function pagination($item_count, $limit, $cur_page, $link) { $page_count = ceil($item_count/$limit); $current_range = array(($...
https://iskablogs.blogspot.com/2014/03/pagination-function-php-example.html
function pagination($item_count, $limit, $cur_page, $link)
{
$page_count = ceil($item_count/$limit);
$current_range = array(($cur_page-2 < 1 ? 1 : $cur_page-2), ($cur_page+2 > $page_count ? $page_count : $cur_page+2));
// First and Last pages
$first_page = $cur_page > 3 ? '1'.($cur_page < 5 ? ', ' : ' ... ') : null;
$
{
$page_count = ceil($item_count/$limit);
$current_range = array(($cur_page-2 < 1 ? 1 : $cur_page-2), ($cur_page+2 > $page_count ? $page_count : $cur_page+2));
// First and Last pages
$first_page = $cur_page > 3 ? '1'.($cur_page < 5 ? ', ' : ' ... ') : null;
$