我想按字母后跟的规则拆分文本。所以我这样做:如何按字母顺序拆分?
$text = 'One two. Three test. And yet another one';
$splitted_text = preg_split("/\w\./", $text);
print_r($splitted_text);
然后我得到这个:
Array ([0] => One tw [1] => Three tes [2] => And yet another one)
但我确实需要它是这样的:
Array ([0] => One two [1] => Three test [2] => And yet another one)
如何解决这个问题?
可能想在这种情况下使分隔符“。”来摆脱空间,但是是的。这个。 – badideas