title: Sorting array of numbers into specific range
body: <p>I have an array in PHP, Basically all I want to do is display the following array into ranges of 5. e.g: 0-5, 6-10, 11-15, 16-20, 21-25 etc:</p>
  
  <pre><code>Array
  (
      [0] =&gt; 00
      [1] =&gt; 01
      [2] =&gt; 02
      [3] =&gt; 03
      [4] =&gt; 04
  )
  </code></pre>
  
  <p>I have looked at the <strong>range()</strong> function - but this seems to output the single numbers from inputting a range. I'm sure this is really simple - thanks in advance:</p>
  
  <p>After using arraychunk() I get the following output:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
      (
          [0] =&gt; 48
          [1] =&gt; 46
          [2] =&gt; 44
          [3] =&gt; 42
          [4] =&gt; 40
      )
  
      [1] =&gt; Array
      (
          [0] =&gt; 39
          [1] =&gt; 38
          [2] =&gt; 37
          [3] =&gt; 36
          [4] =&gt; 35
      )
  
      [2] =&gt; Array
      (
          [0] =&gt; 34
          [1] =&gt; 33
          [2] =&gt; 32
          [3] =&gt; 31
          [4] =&gt; 30
      )
  
      [3] =&gt; Array
      (
          [0] =&gt; 29
          [1] =&gt; 28
          [2] =&gt; 27
          [3] =&gt; 26
          [4] =&gt; 25
      )
  )
  </code></pre>
  
  <p>This in theory works as I asked - however, these are actually <strong>years</strong> so in the first array chunk I looking to output years 1-5. My original array of numbers doesn't contain every year. e.g 1,3,4,6,7, not 1,2,3,4,5</p>