本文介绍了PHP按字符串长度标记字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨网络大师,


只是想知道你是否可以帮助我们想出一些令牌化的

脚本。


我的问题是想把一个很长的内容显示成一个短的段落(通过

给出最小的字母长度)


我的意思是如果我有一个2页内容 - 只是我想只显示4行

有200个字母,然后在内容后跟.....在结束时

简短的pera。


在这方面可以有人帮忙吗,

提前谢谢

Hi Web Masters,

Just wondering wether you can help us to come up with some tokenize
script.

My problem is wanted to display a LONG content into a short para (by
giving minimum letter lenght)

I mean if I have a 2 page content - just I want to display only 4 lines
having 200 letters then follows the content with "....." at the end of
short pera.

Can anybody help in this regards,
Thanks in advance

推荐答案




我写了这个函数来做到这一点。它有一个额外的功能,就是它在空格而不是单词的中间截断。



I wrote this function to do just that. It has the added feature that it
truncates on a space rather than the middle of the word.




这篇关于PHP按字符串长度标记字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-29 04:48
查看更多