title: PHP foreach insert array
body: <p>I have an array of arrays, and I am trying to foreach loop through and insert new item into the sub arrays.</p>
  
  <p>take a look below</p>
  
  <pre><code>            $newarray = array(
                      array("id"=&gt;1,"quantity"=&gt;2),
                      array("id"=&gt;1,"quantity"=&gt;2),
                      array("id"=&gt;1,"quantity"=&gt;2),
             );
  
             foreach($newarray as $item){
                  $item["total"] = 9;
              }
             echo "&lt;br&gt;";
             print_r($newarray);
  </code></pre>
  
  <p>The result just give me the original array without the new "total". Why ?</p>