大家好,我正在尝试以以下格式创建我的分页
转到第 3 页 [文本框] 上一页 1 2 3 4 5 ....400 下一页
下面是我的代码
if(isset($_REQUEST['limit_start']) && $_REQUEST['limit_start'] > 0) $limit_start = $_REQUEST['limit_start'];
else $limit_start = 0 ;
if(isset($_REQUEST['results_to_show']) ) $results_to_show= $_REQUEST['results_to_show'];
else $results_to_show = 100;
if(($limit_start-$results_to_show)>=0)
$pagination.='<a href="details-inventory.php?limit_start='.($limit_start-$results_to_show).'&&results_to_show='.$results_to_show.'" >Previous</a> | ';
if (isset($_REQUEST['submit']) && $_REQUEST['submit'] != "")$search_limited = 1;
else $search_limited = 0;
global $wpdb;
$sql='SELECT count(*)
FROM `inventory_location` ';
$data= $wpdb->get_results($sql,ARRAY_A);
$row_count= $data[0]['count(*)'];
for($number=(($limit_start/$results_to_show)+1);$number<($row_count/$results_to_show);$number++)//($row_count/$results_to_show);$number++)($limit_start/$results_to_show)+
$pagination.= '<a href="details-inventory.php?limit_start='.($number*$results_to_show).'&&results_to_show='.$results_to_show.'" >'.$number.'</a> | ';
$pagination.= ' <a href="details-inventory.php?limit_start='.($limit_start+$results_to_show).'&&results_to_show='.$results_to_show.'" >Next </a> <br />';
现在的问题是......它显示了从 1 到最后一页的所有数字......我想用下面的风格打破它
1 2 3 4 5 ....400
谢谢