Home > Article > Backend Development > Customizing PHP paging function_PHP tutorial
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: