preg_split in php

42

$str = "a. Hello my name is xxx.
b. Hello is my name yyy?
c. Hello my name is rrr!
d. Hello my name is aaa";
$res = preg_split("/\n[a-z].\s/", "\n" . $str);
array_shift($res);
print_r($res);

output

Hello my name is xxx.
Hello is my name yyy?
Hello my name is rrr!
Hello my name is aaa

Comments

Submit
0 Comments