This code works but it's too verbose, how do i make it shorter?
<p>This code actually works but it's a little bit too verbose, i would like to shrink it but i can't find a solution... </p>

<p>Edit: further explanation:  $keywords is an array with a lot of single words extracted from a text. In $text i would like to put al lemmas i can create using adjacent words. Let's say my original text is "I like green apples", in $keywords i have "I","like","green","apples". In $text i will have then "I like", "I like green", "I like green apples" ...</p>

<pre><code>for ($i=0;$i&lt;=count($keywords);$i++) {
        $text[] = $keywords[$i];
        $text[] = $keywords[$i]." ".$keywords[$i+1];
        $text[] = $keywords[$i]." ".$keywords[$i+1]." ".$keywords[$i+2];
        $text[] = $keywords[$i]." ".$keywords[$i+1]." ".$keywords[$i+2]." ".$keywords[$i+3];
        $text[] = $keywords[$i]." ".$keywords[$i+1]." ".$keywords[$i+2]." ".$keywords[$i+3]." ".$keywords[$i+4];
        $text[] = $keywords[$i]." ".$keywords[$i+1]." ".$keywords[$i+2]." ".$keywords[$i+3]." ".$keywords[$i+4]." ".$keywords[$i+5];
        $text[] = $keywords[$i]." ".$keywords[$i+1]." ".$keywords[$i+2]." ".$keywords[$i+3]." ".$keywords[$i+4]." ".$keywords[$i+5]." ".$keywords[$i+6];    
    }
</code></pre>
