I've created a simple page which fetches results from a mysql database and displays them with pagination. Currently it doesn't limit the number of pages shown, so if there are 26 pages and page 14 was selected, it would look something like this: Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Next I think there are too far too many pages displayed I would rather display the links in a phpbb style, something like this: Prev 1 2 3 ... 12 13 14 15 16 ... 24 25 26 Next The number of pages is stored in $total_pages and the current page is $current_page Has anyone done this before? I've looked at phpbbs generate_pagination function but its pretty complicated Thanks Daniel