PHP's preg_split question

Posted by WekiLol on Stack Overflow See other posts from Stack Overflow or by WekiLol
Published on 2010-03-08T18:10:04Z Indexed on 2010/03/08 18:21 UTC
Read the original article Hit count: 217

Filed under:

I want to split text by the letter-followed-by-period rule. So I do this:

$text = 'One two. Three test. And yet another one';
$splitted_text = preg_split("/\w\./", $text);
print_r($splitted_text);

Then I get this:

Array ( [0] => One tw [1] => Three tes [2] => And yet another one )

But I do need it to be like this:

Array ( [0] => One two [1] => Three test [2] => And yet another one )

How to settle the matter?

© Stack Overflow or respective owner

Related posts about php