In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to write php page number form paging function to support static address and ajax paging", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to write php page number form paging function to support static address and ajax paging" bar!
Every time I encountered paging before, I always had to write it myself, and I felt it was very tedious, so in line with the general principle, I wrote a paging method, which is hereby recorded.
Currently, this page supports static address paging and ajax paging without linked addresses (but js has to write it itself):
The supported static addresses are as follows: www.example.com/xxx-xxx-p1-xxxx-xx.html
Other forms of static need to be rewritten according to one's own situation.
When ajax paging is supported, the $link parameter is empty, but pid and optype are provided, where pid is used to obtain the number of pages, and optype is used to distinguish which paging logic the current trigger action belongs to when there are multiple pages on a page.
The copy code is as follows:
/ *
*
* get the page number
*
* * *
*
* @ params string $link link address (you can use ajax to turn the page when the link is empty)
*
* @ params int $intPage current number of pages
*
* @ params int $intTotal total number of pages
*
* @ params int $intSize the number of pages to display
*
* @ params string $type link type (multiple pages are used to distinguish the page turning area)
*
* * *
*
* @ return array
, /
Private function formatPage ($link= "", $intPage,$intTotal,$intSize=3,$type= "")
{
$strPage =''
If ($intTotal > 0)
{
If ($intPage > 1)
$strPage. = $Linkage.
}
Else
{
StrPage. = 'next page > >'
}
}
$strPage. = "
Return $strPage
}
Thank you for your reading, the above is the content of "how to write php page number form paging function to support static address and ajax paging". After the study of this article, I believe you have a deeper understanding of how to prepare php page number form paging function to support static address and ajax paging. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.