note 101906 deleted from function.array-slice by danbrown

From: Date: Mon, 17 Jan 2011 15:15:34 +0000
Subject: note 101906 deleted from function.array-slice by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-175834@lists.php.net to get a copy of this message
Note Submitter: anaz114119 at gmail dot com ---- <?php function pagination($array,$no){ $count = count($array); $total = ceil($count/$no); $page = isset($_GET['page'])? $_GET['page']:''; if (isset($page)AND $page>0){ if ($page>$total){ $page = $total; }else{ $inizio = $page*$no-$no; } }else{ $page=1; $inizio=0; } $array = array_slice($array,$inizio,$no); return $array; } <?php echo"<a href='www.toptenz.tk'>www.toptenz.tk</a>"; ?>

« previous php.notes (#175834) next »