Advertisement
michaelyuen

Untitled

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