【发布时间】:2017-09-26 06:36:08
【问题描述】:
所以我有这个字符串,因为它太长而无法放入我的报告中。我的报告应该只使用 36 个字符。但我的字符串值不止于此:
$value = "The quick brown fox jumps over the lazy dog" //43 character
如果只获得 36 个字符,那么您将获得:“快速棕色狐狸跳过 l” 但我想用单词而不是字符来划分句子,所以我想从中制作 2 个变量
$var1 = "The quick brown fox jumps over the" //instead of The quick brown fox jumps over the l
$var2 = "lazy dog"
我该怎么做???
【问题讨论】:
-
str_word_count();也许
标签: php string substring strlen