Pagination Madness


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // pagination
  2. $itemcount = $res->length();
  3. $pagemin = ($itemcount / 4);
  4. $pagemax = (($itemcount / 4) + .499);
  5. $roundmax = round($pagemax);
  6. $roundmin = round($pagemin);
  7. if ( (intval($roundmax) - intval($roundmin) === 1) ) {
  8. $pages = intval($roundmax);
  9. } else {
  10. $pages = intval($roundmin);
  11. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.