Acting on items in an array 1/3 at a time
<p>I have an array that has 22 items in it (it may also have 7, 10 or 11 items in it)</p>

<p>Old, crappy example: <strike>$anArray = array(1=>'A',2=>'B',3=>'C',4=>'D',5=>'E',6=>'F',7=>'G',8=>'H',9=>'I'); </strike></p>

<p><strong>Better example:</strong></p>

<pre><code>Array(
[25] =&gt; #
[50] =&gt; #
[53] =&gt; #
[55] =&gt; #
[56] =&gt; #
[57] =&gt; #
[58] =&gt; #
[59] =&gt; #
[60] =&gt; #
[61] =&gt; #
[62] =&gt; #
[63] =&gt; #
[64] =&gt; #
[65] =&gt; #
[66] =&gt; #
[67] =&gt; #
[68] =&gt; #
[69] =&gt; #
[70] =&gt; #
[71] =&gt; #
[72] =&gt; #
[73] =&gt; #)
</code></pre>

<p>I also have three variables: </p>

<pre><code>$A='A'; $B='B'; $C='C';
</code></pre>

<p>I need change the first 1/3(*ish) of the items in the array from what they are to $A
...the 2nd third to $B
...and the final third to $C</p>

<p>Old, crappy example:<strike>Array([1]=>A [2]=>A [3]=>A [4]=>B [5]=>B [6]=>B [7]=>C [8]=>C [9]=>C)</strike></p>

<p><strong>Better example:</strong></p>

<pre><code>Array(
[25] =&gt; A
[50] =&gt; A
[53] =&gt; A
[55] =&gt; A
[56] =&gt; A
[57] =&gt; A
[58] =&gt; A
[59] =&gt; B
[60] =&gt; B
[61] =&gt; B
[62] =&gt; B
[63] =&gt; B
[64] =&gt; B
[65] =&gt; B
[66] =&gt; B
[67] =&gt; C
[68] =&gt; C
[69] =&gt; C
[70] =&gt; C
[71] =&gt; C
[72] =&gt; C
[73] =&gt; C)
</code></pre>

<p>Is there an easy and straight-forward way of doing this?  Right now I'm doing lots of foreach with counters, etc... and it seems like to much work.</p>

<p>Also...The keys cannot change...sorry.</p>

<p>*By ish I mean about a third - 7-8-7 or 7-7-8 would work fine</p>
