: This article mainly introduces the simplest php paging mode. if you are interested in the PHP Tutorial, refer to it.
1) {$ pagination. =""; If ($ page> 1) $ pagination. = "previous page"; else $ pagination. = "previous page"; if ($ lastpage <7 + ($ adjacents * 2) {for ($ counter = 1; $ counter <= $ lastpage; $ counter ++) {if ($ counter = $ page) $ pagination. = "$ counter"; else $ pagination. = "$ counter" ;}} elseif ($ lastpage> 5 + ($ adjacents * 2) {if ($ page <1 + ($ adjacents * 2 )) {for ($ counter = 1; $ counter <4 + ($ adjacents * 2); $ counter ++) {if ($ counter = $ page) $ pagination. = "$ counter"; else $ pagination. = "$ counter";} $ pagination. = "... "; $ pagination. = "$ lpm1"; $ pagination. = "$ lastpage";} elseif ($ lastpage-($ adjacents * 2)> $ page & $ page> ($ adjacents * 2) {$ pagination. = "1"; $ pagination. = "2"; $ pagination. = "... "; for ($ counter = $ page-$ adjacents; $ counter <= $ page + $ adjacents; $ counter ++) {if ($ counter = $ page) $ pagination. = "$ counter"; else $ pagination. = "$ counter";} $ pagination. = "... "; $ pagination. = "$ lpm1"; $ pagination. = "$ lastpage";} else {$ pagination. = "1"; $ pagination. = "2"; $ pagination. = "... "; for ($ counter = $ lastpage-(2 + ($ adjacents * 2); $ counter <= $ lastpage; $ counter ++) {if ($ counter = $ page) $ pagination. = "$ counter"; else $ pagination. = "$ counter" ;}}}if ($ page <$ counter-1) $ pagination. = "next page"; else $ pagination. = "next page"; $ pagination. ="
\ N ";}?> // Put the main table here
// Display the page numberThe source is no longer available ......
The above introduces the simplest php paging, including some content. I hope my friends who are interested in PHP tutorials can help me.