Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php pagination ellipsis

$count = 7; // number to show
// start at half threshold down from the current location.
$number = $current - round($count/2); 
if( $number > 1 ) echo '...';
else $ // increase to have number start at 1.
for( $number; $number < $number + $count; $number++)
{
    // your for loop as normal
}
if( $number < $total ) echo '...';
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #pagination #ellipsis
ADD COMMENT
Topic
Name
8+8 =