Location: PHPKode > scripts > Pager > pager/index.php
<html>
<body bgcolor=white>
<h2>Example of Pager object.</h2>
<p>
<p>
<?
require "Pager.php";
require "Page.php";

# setting up target array
$ar=array();
for ($i=0;$i<123;$i++) {
    $ar[]=$i;
}

$elems_per_page = 12;
$pager = new Pager($ar,$elems_per_page);

# $pageno - input parameter
if (empty($pageno)) {
        $pageno = 1;
}

#printing page nummbers
$pager->printPageNumbers($pageno,'series');

echo "<p>";
# printing page result
$page = $pager->page($pageno);
while (list($key,$val)=each($page->result)) {
        echo "$val<br>";
}

?>
</body>
</html>
Return current item: Pager