Home  >  Article  >  Backend Development  >  Customizing PHP paging function_PHP tutorial

Customizing PHP paging function_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:07:29826browse

Every time you write a list page, you almost have to write a paging program. Recently, Xiaoyang finally decided to do it once and for all - to customize a paging function and save it in the "pageft.php" file. If you want to use paging, just include the "pageft.php" file directly and call this function. When Xiaoyang wrote this function, he tried his best to pay attention to the portability and ease of use of the program. The following is the function written by Xiaoyang:



Okay, the paging function has been written and saved as "pageft.php". When you want to paginate, include it and call the pageft() function. However, it does not output anything, but generates several global variables for use: $firstcount, $displaypg, $pagenav.

The following examples illustrate its usage:



The following figure shows the navigation bar format. Effect:

Customizing PHP paging function_PHP tutorial

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/315090.htmlTechArticleEvery time you write a list page, you almost have to write a paging program. Recently, Xiaoyang finally decided to solve it once and for all - customize a paging function and save it in "pageft.ph...
Statement:
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