title: Generate word combinations
body: <p>For example this is my text :</p>
  
  <pre><code>$str = 'buy new microsoft windows';
  </code></pre>
  
  <p>I explode text  and list with array :</p>
  
  <pre><code>Array
  (
      [0] =&gt; buy
      [1] =&gt; new
      [2] =&gt; microsoft
      [3] =&gt; windows
  )
  </code></pre>
  
  <p>I want to generate words in array to something like this:</p>
  
  <pre><code>buy new
  buy new windows
  buy microsoft 
  buy microsoft windows
  buy windows
  new microsoft
  new microsoft windows
  new windows
  microsoft windows
  </code></pre>
  
  <p>I tried with foreach and rand but I couldn't generate like showed. Is there any chance to generate just like my request?</p>