Home > php教程 > php手册 > 基于tp的数组分页

基于tp的数组分页

WBOY
Release: 2016-06-07 11:44:17
Original
1923 people have browsed it

或许有的时候数据并不是全都是从库里面查出来的吧!那天遇到一个就是先查出库里面的数据,然后在通过条件判断,得到一个数组!这个时候用到分页了,怎么整?看看
function array_page($array,$rows){<br> <br>             import("ORG.Util.Page"); //导入分页类<br>             $count=count($array);<br>             $Page=new Page($count,$rows);<br>             $list=array_slice($array,$Page->firstRow,$Page->listRows);<br>             return $list;<br> <br> }

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template