title: Breaking an array into groups based on values
body: <p>Using PHP, I'm trying to break an array up into multiple arrays based on groups of values. The groups are based on the values being between 1 and 5. But here's the hard part...</p>
  
  <p>I need to loop through the array and put the first set of values that are between 1 and 5 in their own array, then the next set of values that are between 1 and 5 in their own array, and so on.</p>
  
  <p>But each group WON'T always include 1,2,3,4,5. Some groups could be random.</p>
  
  <p>Examples:</p>
  
  <p>1,1,2,2,3,4,5 - this would be a group</p>
  
  <p>1,2,3,4,4,4 - this would be a group</p>
  
  <p>1,2,3,3,5 - this would be a group</p>
  
  <p>2,2,3,3,5 - this would be a group</p>
  
  <p>So I can't just test for specific numbers.</p>
  
  <pre><code>Array
  (
      [0] =&gt; 1
      [1] =&gt; 2
      [2] =&gt; 3
      [3] =&gt; 4
      [4] =&gt; 5
      [5] =&gt; 1
      [6] =&gt; 2
      [7] =&gt; 3
      [8] =&gt; 4
      [9] =&gt; 4
      [10] =&gt; 1
      [11] =&gt; 1
      [12] =&gt; 3
      [13] =&gt; 4
      [14] =&gt; 5
  )
  </code></pre>
  
  <p>Any Ideas?</p>