A simple and stylish PHP pagination function by Dan Palka. Free for everyone!
Get CodeAbout | How to Use | Example Output | Interactive Demo | Email Me
While working on a website project with multiple pages of information, I found myself unsatisfied with the pagination scripts available on the internet. I decided to write my own from scratch, and becmae quite obsessive about it's appearance and functionality. The result is PHPagination, which you can learn about and download here.
![]()
To use PHPagination, you simply call the PHPagination function and pass four arguments; the zero-based current page, the zero-based ending page, a string you'd like to appear before the pagination result, and a string you'd like to appear after each pagination result. PHPagination does the rest, and returns a nicely formatted line of HTML pagination.
PHPagination was designed to satisfy the following requirements: