title: Array of associative arrays, add new elements to the associative arrays
body: <p>If I have an array like this:</p>
  
  <pre><code>array(2) {
    [0]=&gt;
    array(2) {
      ["id"]=&gt;
      string(2) "34"
      ["total"]=&gt;
      string(6) "122337"
    },
  [1]=&gt;
    array(2) {
      ["id"]=&gt;
      string(2) "43"
      ["total"]=&gt;
      string(6) "232337"
    }
  }
  </code></pre>
  
  <p>And I want to add a new key value to each sub array, so for example, it would end like this:</p>
  
  <pre><code>array(2) {
        [0]=&gt;
        array(2) {
          ["id"]=&gt;
          string(2) "34"
          ["total"]=&gt;
          string(6) "122337"
          ["newkey"]=&gt;
          string(6) "hihihi"
        },
      [1]=&gt;
        array(2) {
          ["id"]=&gt;
          string(2) "43"
          ["total"]=&gt;
          string(6) "232337"
         ["newkey"]=&gt;
          string(6) "hihihi"
        }
      }
  </code></pre>
  
  <p>How would I do it?</p>
  
  <p>I have tried with a foreach like this:</p>
  
  <pre><code>foreach($exterior_array as $inside_array) {
   $inside_array['newkey'] = "hihihi";
  }
  </code></pre>
  
  <p>But once I get inside the foreach, the values are not saved.</p>