i\'m a newbie in php especially on making pagination.
my question is, how to make paging like stackoverflow\'s pagination?
i mean paging like this :
1
Somewhat like this(pseudo-code):
pg = CurrentPageNo
low = 1
high = MAX_PAGES
if (pg-low <=5)
output 1 to pg-1 [with links]
else
output 1..3 [with links]
output "..."
output (pg-3) to (pg-1) [with links]
output pg
if (high - pg <=5)
output pg+1 to high [with links]
else
output (pg+1) to high-3 [with links]
output "..."
output (high-2) to high [with links]