PHP is simple to implement the paging function of text files
<! doctype>a{padding:20px; } </style>PHP//Chinese character handlingfunctionM_SUBSTR ($str,$start,$length){ $str _length=$start+$length;//get total intercept length $tmp _str= ""; for($i= 0;$i<$str _length;$i++){ if(Ord(substr($str,$i, 1)) = = 0x0a){ $tmp _str. = "<br>"; } if(Ord(substr($str,$i, 1)) >0xa0){ $tmp _str.=substr($str,$i, 2); $i++; }Else{ $tmp _str.=substr($str,$i, 1); } } return $tmp _str;}//pass-through parameter processingif(isset($_get[' Page '])){ $page=$_get[' Page '];}Else{ $page= 1;}$counter=file_get_contents("Example.txt");$length=strlen($counter);$page _count=Ceil($length/400);$pre _str= M_substr ($counter, 0, ($page-1) *400);$now _str= M_substr ($counter, 0,$page*400);Echo substr($now _str,strlen($pre _str),strlen($now _str)-strlen($pre _str));Echo"<br><br>";EchoThe current page.$page." /".$page _count;Echo"<a href= ' index.php?page=1 ' >Index</a>";if($page>1){ Echo"<a href= ' index.php?page=". ($page-1). "' >Pre</a> ";}if($page<$page _count){ Echo"<a href=index.php?page=". ($page+1). " >Next</a> ";}Echo"<a href=index.php?page=$page _count>End</a> ";?></body>PHP is simple to implement the paging function of text files