ページング

<?php

function paging($limit,$page,$disp=5){
  $page = empty($_GET&#91;"page"&#93;)? 1: $_GET&#91;"page"&#93;;

  $next = $page + 1;
  $prev = $page - 1;

  if($page != 1){
    print '<a href="?page=' .$prev. '">&laquo; 前へ</a>';
  }
  if($page < $limit){
    print '<a href="?page='.$next.'">次へ &raquo;</a>';
  }
}

$limit = 10;
$page = empty($_GET["page"])? 1:$_GET["page"];
?>