Let's say I have a line:
$string = "This is my test case for an example."
If I explode based on "I get
Array('This','is','my','test','case','for','an','example.');
I want to explode for any other space:
Array('This is','my test','case for','an example.').
A string may contain an odd number of words, so the last element in the array may not contain two words.
Does anyone know how to do this?
Ahmedf
source
share