I'm trying to do a simple word cloud exercise in PHP but with little twist. I have everything else done but I can't figure out how to do a loop that combines the words.
Here's example that will make it little bit easier to understand what I'm trying to do:
I have array like this:
$arr = array('linebreak','indent','code','question','prefer','we','programming')
Now I'm trying to do a function that starts going thru that array and gives me arrays like these:
Array( [0] => 'linebreak' [1] => 'linebreak indent' [2] => 'linebreak indent code' )
Array( [0] => 'indent' [1] => 'indent code' [2] => 'indent code question' )
So basically it goes thru the original words array word by word and makes these little arrays that has 1 to 5 next words combined.