我在寻找沿PHP:没有打破的话分割的长字符串
str_split_whole_word($longString, x)
所在行$longString
是句子的集合东西,x
是每行的字符长度。它可能相当长,我想基本上将它分成多行,形式为数组。
因此,例如,
$longString = 'I like apple. You like oranges. We like fruit. I like meat, also.';
$lines = str_split_whole_word($longString, x);
$lines = Array(
[0] = 'I like apple. You'
[1] = 'like oranges. We'
[2] = and so on...
)
Marcio,谢谢你的帮助。这有助于你的描述! – musicliftsme
@ user796837,Nevermind,很高兴为您效劳! –