Home > Article > Backend Development > Extra long text paging display function implemented in PHP
This article mainly introduces the paging display function of ultra-long text implemented by PHP, involving PHP's calculation, interception, traversal and other related operation skills for strings. It can realize the paging display function of ultra-long text. Friends who need it can Refer to the following
The example of this article describes the paging display function of ultra-long text implemented in PHP. Share it with everyone for your reference, the details are as follows:
1. Code
1, index.php
超长文本的分页显示
|
||||||
2 , function.php
0xa0){ //如果字符串中首个字节的ASCII序数值大于0xa0,则表示为汉字 $tmpstr.=substr($str,$i,2); //每次取出两位字符赋给变量$tmpstr,即等于一个汉字 $i++; //变量自加1 }else{ //如果不是汉字,则每次取出一位字符赋给变量$tmpstr $tmpstr.=substr($str,$i,1); } } return $tmpstr; //输出字符串 } ?>
2. Running results
phprealnowreport (jpgraph plug-inrealnow)
The above is the detailed content of Extra long text paging display function implemented in PHP. For more information, please follow other related articles on the PHP Chinese website!