1
可能重复:
How to Truncate a string in PHP to the word closest to a certain number of characters?剥离和修剪关键字列表?
我有一个关键字像下面
word1, word3, word3, word4, word5
现在说这个名单是400个字符长的字符串。我只想要关键字达到255个字符,但我也想修剪最后一个字,因为它可能只有半个字。
说我修剪的关键字列表以及与此
word1, word3, word3, wo
最终如何确保我修剪只有当它的半个字
在这个任何想法硬道理?我不知道从哪里开始
顺便说一句,我使用PHP