Add Data to 3 Dim Array
<p>I have the following array containing a master record of training courses held on a system (<code>select_group</code> just identifies related course groups):</p>

<pre><code>Array
(
    [DE00041-1] =&gt; Array
        (
            [select_group] =&gt; 1
        )
)
</code></pre>

<p>The training course ids are then queried against a table containing only running courses whilst also grabbing extra information. </p>

<p>As one training course may run more than once per year they have a <code>running_id</code> which gives the following:</p>

<pre><code>Array
(
    [DE00041-1] =&gt; Array
        (
            [title] =&gt; xxx
            [405] =&gt; Array
                (
                    [start_quarter] =&gt; 1
                    [end_quarter] =&gt; 1
                )
        )
)
</code></pre>

<p>What I then need to do is add the original array <code>select_group</code> data into the newly created array.</p>

<p>The end result should be:</p>

<pre><code>Array
(
    [DE00041-1] =&gt; Array
        (
            [title] =&gt; xxx
            [select_group] =&gt; 1
            [405] =&gt; Array
                (
                    [start_quarter] =&gt; 1
                    [end_quarter] =&gt; 1
                )
        )
)
</code></pre>

<p>I have looked over other SO / Google answers but couldn't find what I was looking for.</p>

<p>There may be 1-20 training courses listed, each one running once to four times per year.</p>
