phrase split algorithm in PHP
- by Eric Sim
Not sure how to explain. Let's use an example. Say I want to split the sentence
"Today is a great day."
into
today
today is
today is a
today is a great
today is a great day
is
is a
is a great
is a great day
a
a great
a great day
great
great day
day
The idea is to get all the sequential combination in a sentence.
I have been thinking what's the best way to do it in PHP. Any idea is welcome.