[PHP]代码
view sourceprint?
01
02session_start();
03if (empty($page)) {$page=1;}
04if (isset($_GET['page'])==TRUE) {$page=$_GET['page']; }
05?>
06
07
08
09www.qqview.com-Read Result
10
16
17
18
19
20
21
22if($page){
23$counter=file_get_contents("example.txt"); //-------read the file into a string.-------
24$length=strlen($counter);
25$page_count=ceil($length/5000);
26
27function msubstr($str,$start,$len){
28$strlength=$start+$len;
29$tmpstr="";
30for($i=0;$i
31if(ord(substr($str,$i,1))==0x0a) {
32$tmpstr.='
';
33}
34if(ord(substr($str,$i,1))>0xa0) {
35$tmpstr.=substr($str,$i,2);
36$i++;
37}
38else{
39$tmpstr.=substr($str,$i,1); }
40}
41return $tmpstr;
42}
43//--------------------------截取中文字符串--------------------------