Advertisement
michaelyuen

Untitled

Dec 5th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <?php
  2. function page($page_num) {
  3.     $query = $_GET;
  4.     $query['pn'] = $page_num;
  5.     $query_result = http_build_query($query);
  6.     return "<a href='{$_SERVER['PHP_SELF']}?{$query_result}' class='btn btn-default'>{$page_num}</a>";
  7. }
  8.  
  9. for($i = $pagenum+1; $i <= $last; $i++){
  10. $paginationCtrls .= page($i) .' &nbsp; ';
  11.     if($i >= $pagenum+4){
  12.         break;
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement