我想按字母后跟的規則拆分文本。所以我這樣做:如何按字母順序拆分?
$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