How to Split a Paragraph into Sentences

前端 未结 3 568
天命终不由人
天命终不由人 2020-12-12 01:08

I\'ve been trying to use:

$string=\"The Dr. is here!!! I am glad I\'m in the U.S.A. for the Dr. quality is great!!!!!!\";
preg_match_all(\'~.*?[?.!]~s\',$str         


        
3条回答
  •  轮回少年
    2020-12-12 01:53

    hmmm maybe try something like $sentences = preg_split('/.*?[?.!]+\s+/', $string);

提交回复
热议问题