PHP FCK article pagination

Source: Internet
Author: User

PHP FCK article pagination fckeditor article page code

<?php
$page =isset ($_get[' page ')? $_get[' Page ']:1;//here. Pagination number of the current article if not, 1.
$split = ' <div style= "page-break-after:always" ><span style= "Display:none" >&nbsp;</span></ Div> ';

Here is the pagination code for the FCKeditor article


$array =explode ($split, $rs->new_content);


if ($page >sizeof ($array)) {//To determine whether the paging number obtained from the address bar is greater than the length of the total page and, if so, to output the contents of the first page
echo $array [0];
}else{
echo $array [$page -1];//not output $page-1 here because the subscript for PHP functions starts at 0.
}
if (sizeof ($array) >1) {//here is to determine if the article does not page pagination does not show the nth page,
for ($i =1; $i <=sizeof ($array); $i + +) {
echo "<a href=?id= $type _id&page=". $i. " >[". $i." Page]</a>&nbsp; ";
}
}

?>

Original article: Www.111cn.net reprint Please specify

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.