paging like stackoverflow's
问题 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 ... 5 6 7 8 9 ... 25 (the first number and the last number is always appear, but in the middle only 5 numbers with the selected page absolutely in the middle) in php i have tried making paging, <?php //Show page links for($i=1; $i<=$pages; $i++) { echo '<li id="'.$i.'">'.$i.'</li>'; } ?> but it will be shown all of pages like 1 2 3 4 5 6 7 8 9 10