配列$ myarrayがあります。私はここで、配列の内容をページ分割したいは私がやってを考えていますものです:配列をページ分割する
//Find total number of rows
$all_rs = $newArrayOfRows;
$this->total_rows = count($all_rs);
//Max number of pages
$this->max_pages = ceil($this->total_rows/$this->rows_per_page);
if ($this->links_per_page > $this->max_pages) {
$this->links_per_page = $this->max_pages;
}
//Check the page value just in case someone is trying to input an aribitrary value
if ($this->page > $this->max_pages || $this->page <= 0) {
$this->page = 1;
}
//Calculate Offset
$this->offset = $this->rows_per_page * ($this->page - 1);
//Fetch the required result set
私は私の最初の配列から、私はすべてのページのために必要なだけの情報を取得するために、すべてこの情報に参加するにはどうすればよい
? Ty非常に
私は初心者だ、それはuがideeaを持って、それを投稿し、記入した場合ので、私は、何のわからないんだけど...あなたの助けはどこかに行くと、暗闇の中でフィッシングのようなものです:)私はそれがうまくいくかどうかを私に聞かせてくれます。 – webmasters