title: Merging 2 key Arrays into 1 Associative Array
body: <p>I have 2 arrays, 1 called $person and the other called $classes. I'd like to merge the 2 together into 1 array and assign a name to item in the new merged array. Therefore creating an associative array as opposed to using keys that array_merge seems to be made by default using the array_merge function. (For clarity 1 person has multiple classes.)</p>
  
  <p>Currently I have this:</p>
  
  <p>($person)</p>
  
  <pre><code>[1]=&gt;
     array(2) {
       ["Name"]=&gt;
         string(1) "Bobby Moore"
       ["Age"]=&gt;
         string(18) "36"
  </code></pre>
  
  <p>($classes)</p>
  
  <pre><code>   [1]=&gt;
       array(2) {
       [0]=&gt;
         array(11) {
           ["Class ID"]=&gt;
             string(1) "12"
           ["Class Title"]=&gt;
             string(18) "Math 101"
       [1]=&gt;
         array(11) {
           ["Class ID"]=&gt;
             string(1) "13"
           ["Class Title"]=&gt;
             string(18) "Math 102"
       [1]=&gt;
         array(11) {
           ["Class ID"]=&gt;
             string(1) "14"
           ["Class Title"]=&gt;
             string(18) "Math 103"
  </code></pre>
  
  <p>Is it possible to get the following result?</p>
  
  <pre><code>   [person]=&gt;
       array(1) {
       [0]=&gt;
         array(11) {
           ["Name"]=&gt;
             string(1) "Bobby Moore"
           ["Ages"]=&gt;
             string(18) "35"
     [Classes]=&gt;
       array(2) {
       [0]=&gt;
         array(11) {
           ["Class ID"]=&gt;
             string(1) "12"
           ["Class Title"]=&gt;
             string(18) "Math 101"
       [1]=&gt;
         array(11) {
           ["Class ID"]=&gt;
             string(1) "13"
           ["Class Title"]=&gt;
             string(18) "Math 102"
       [1]=&gt;
         array(11) {
           ["Class ID"]=&gt;
             string(1) "14"
           ["Class Title"]=&gt;
             string(18) "Math 103"
  </code></pre>
  
  <p>Currently I'm using array_merge($person ,$classes); which unfortunately is an array sorted by keys.</p>
  
  <p>I hope this makes sense! Thank you in advance!</p>