所以我有這個字符串,它太長了,不能放在我的報告中。我的報告應該只使用36個字符。但我的字符串值是不止於此:php子字符串(substr)檢測字符不是字符
$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();也許 –