<?php
header("content-type:text/html;charset=utf8");
include "page.php";
$page=new page(1000000,100);
echo $page->fpage();
?>
、、
<?php
class page{
private $page;
private $total;
private $num;
public function __construct($total,$num){
$this->total =$total;
$this->num =$num;
$this->page=$this->getpage();
}
public function getpage(){
return ceil($this->total/$this ->num);
}
public function fpage(){
return "共{$this->total}页 每页显示{$this->num}条记录 这是第3页 3/{$this->page} 首页 1 2 3 4 5 6 7 8 下一页 末页 ";
}
}
时间: 2024-10-13 21:58:00