Home>Article>Backend Development> PHP reads and pages txt text files
This article mainly introduces the method of PHP reading txt text files and displaying them in pages. It involves the skills of PHP file operation. It has certain reference value. Friends in need can refer to it.
The examples in this article are described How to read txt text file in PHP and display it in pages.
The specific implementation method is as follows:
The code is as follows:
Read Result
'; } if(ord(substr($str,$i,1))>0xa0) { $tmpstr.=substr($str,$i,2); $i++; } else{ $tmpstr.=substr($str,$i,1); } } return $tmpstr; } //------------截取中文字符串--------- $c=msubstr($counter,0,($page-1)*5000); $c1=msubstr($counter,0,$page*5000); echo substr($c1,strlen($c),strlen($c1)-strlen($c)); }?> |
/ 页 | 首页 "; if($page!=1){ echo "上一页 "; } if($page<$page_count){ echo "下一页 "; } echo "尾页"; ?> |
Summary: The above is the entire content of this article, I hope it can help everyone learn Helps.
Related recommendations:
php example analyzes the concept of class constants in php
PHP method to convert full-width characters to half-width characters
PHP implements the batch upload function for specified suffix files
The above is the detailed content of PHP reads and pages txt text files. For more information, please follow other related articles on the PHP Chinese website!