Split an Array into 3 arrays
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/12876333/slice-an-array-into-4-other-arrays">Slice an array into 4 other arrays</a>  </p>
</blockquote>



<p>An array can be split into 3 smaller arrays using:</p>

<pre><code>$things = array('...');    // an array containing 9 things
$things = array_chunk($things, count($things)/3);
</code></pre>

<p><strong>Problem:</strong> However when <code>count($things)</code> the number of items in the array cannot be divided equally by <code>3</code>, I end up with <strong>4</strong> smaller arrays. Example, if I have 10 elements in array <code>$things</code>, inputting it into <code>array_chunk()</code> gives me 3 arrays of 3 elements, and a 4th array containing 1 element.</p>

<p>How can I divide an array into 3 smaller arrays, such that if I have a situation like in the example above, I will end up with</p>

<pre><code>count($things[0]) == 4
count($things[1]) == 4
count($things[2]) == 2
</code></pre>

<p>Bascially what I am doing is to take a big array and display it as equally as possible into 3 columns. It's alphabetically sorted, so sequence is important.</p>
