php restructing an array
<p>Given my Array</p>

<pre><code>array [0]
    fielda: cca
    fieldb: my value b
    fieldc: my value c
    fieldd: my value d

array [1]
    fielda: cca
    fieldb: my value b
    fieldc: my value c
    fieldd: my value d

array [2]
    fielda: cca
    fieldb: my value b
    fieldc: my value c
    fieldd: my value d

array [3]
    fielda: ccb
    fieldb: my value b
    fieldc: my value c
    fieldd: my value d

array [4]
    fielda: ccb
    fieldb: my value b
    fieldc: my value c
    fieldd: my value d
</code></pre>

<p>Is there a simple way to restructure it so that fielda is grouped like so</p>

<pre><code>array [0]
    fielda: cca
        array [0]
            fieldb: my value b
            fieldc: my value c
            fieldd: my value d
        array [1]           
            fieldb: my value b
            fieldc: my value c
            fieldd: my value d
        array [2]                   
            fieldb: my value b
            fieldc: my value c
            fieldd: my value d
        array [3]                   

array [1]
    fielda: ccb
        array [0]
            fieldb: my value b
            fieldc: my value c
            fieldd: my value d
        array [1]           
            fieldb: my value b
            fieldc: my value c
            fieldd: my value d
</code></pre>
