Hi Guys,
does anyone know how split a text into groups depending on how many words are in the text
e.g
$text = "If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. ";
I want a maximium of 5 words in each group, so the above text will be split as such
$text1 = 'If you are new to';
$text2 = 'PHP and want to get';
$text3 = 'some idea of how it ';
$text4 = 'works, try the introductory tutorial.';
But if I want a maximium of 10 words in each group, so the above text will then be split like this
$text1 = 'If you are new to PHP and want to get';
$text2 = 'some idea of how it works, try the introductory tutorial.';
$text3 = '';
$text4 = '';
Is this possible?
Please any help will be much appreciated thanks