1 2 3 4 5 6 7 8 9 10
<?php $pages = array_keys(range(1, 115, 10)); $current = 5; $threshold = 3; print_r(array_slice($pages, $current - $threshold, $threshold * 2 + 1)); ?>
Array ( [0] => 2 [1] => 3 [2] => 4 [3] => 5 [4] => 6 [5] => 7 [6] => 8 )