Duplicate: http://stackoverflow.com/questions/840807/wondering-how-to-do-php-explode-over-every-other-word
$string = "This is my test case for an example."
If I do explode based on ' '
I get an
Array('This','is','my','test','case','for','an','example.');
What I want is an explode for every other space.
I'm looking for the following output:
Array(
[0] => Array (
[0] => This is
[1] => is my
[2] => my test
[3] => test case
[4] => case for
[5] => for example.
)
so basically every 2 worded phrases is outputted.
Anyone know a solution????