Pagination Function PHP example

function pagination($item_count, $limit, $cur_page, $link) { $page_count = ceil($item_count/$limit); $current_range = array(($...

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;
$

Hot in Week

Popular

Archive

item