Home > Article > Backend Development > PHP page number form paging function supports static address and ajax paging_PHP tutorial
Every time I encountered pagination before, I always had to write it myself, which seemed quite tedious, so based on the general principle, I wrote a pagination method and recorded it here.
Currently, this paging supports static address paging and ajax paging when there is no link address (but js must be written by yourself):
The supported static addresses are as follows: www.example.com/xxx- xxx-p1-xxxx-xx.html
Other forms of staticization need to be rewritten according to your own situation
When supporting ajax paging, the $link parameter is empty, but pid and optype are provided. Among them, pid is used to obtain the page number, and optype is used to distinguish which paging logic the current trigger action belongs to when there are multiple pages on a page