This one shows two links before and two after the current requested link:
5? 5 : $last;
}
if ($curr1>=$last) {
$curr0 = $last-4 < 1 ? 1 : $last-4;
$curr1 = $last;
}
// now print all links:
echo '
« ';
for ($i=$curr0; $i<=$curr1; $i++) {
$style = ($i==$current)? 'font-weight:bold':'';
echo '
'.$i.' ';
}
echo '
» ';
?>
This shows links like this: « 13 14 15 16 17 »
Imho it's not so difficult to add also first five and last five links by adding appropriate conditions.
Testing script here