Is there a simple way to convert a paragraph of text into an array of sentences?
How would I turn this:
$paragraph = "Sentence number one. Sentence number two. Sentence number three."
...into this:
Array([0]=>"Sentence number one." [1]=>"Sentence number two."[3]=>"Sentence number three.")
Isn't there a split method or something in php?
String to Array
Moderator: General Moderators
Re: String to Array
It can get really complicated really quickly.
If you don't have words like "Mr." or numbers like "1.2" then you can explode on a period. Otherwise you're probably stuck with regular expressions.
(PS: We have a Regex forum.)
If you don't have words like "Mr." or numbers like "1.2" then you can explode on a period. Otherwise you're probably stuck with regular expressions.
(PS: We have a Regex forum.)