= $tenthpages ) { $back10position = $startpos - $tenthpages ; $pagestring .= ' '; } if($startpos >= $rowsperpage) { $backposition = $startpos - $rowsperpage; $pagestring .= 'back '; } if($totalrows != '') { $page = ceil($startpos / $rowsperpage); $pagecount = $page + $numpages; $pageno = ceil($startpos / $rowsperpage ) ; // echo ' page no ' . $pageno ; for($i = 1,$pgcnt=1; $page { if ( $pageno == $pgcnt ) { $pagestring .= ' '.$pgcnt.' '; $pgcnt++; } elseif ($i { $pagestring .= ' '.$pgcnt.' '; $pgcnt++; }; $page++; }; } $nextposition = $startpos + $rowsperpage; if($totalrows == '') { $pagestring .= 'next '; } elseif($startpos { if ( $nextposition { $pagestring .= 'next '; } } if($startpos { $next10position = $startpos + $tenthpages ; if($next10position { $next10position = $startpos + $tenthpages ; $pagestring .= ' >>'; } } return $pagestring; }?>
复制代码
分页, 查询结果, php
