title: Codeigniter Add new key and value to object(stdClass) inside foreach loop
body: <p>I am trying to add another key and value to the an array inside the foreach loop.
  I have the following array.</p>
  
  <pre><code>    array (size=2)
    0 =&gt; 
      object(stdClass)[27]
        public 'ID' =&gt; string '1' (length=1)
        public 'sectiontitle' =&gt; string 'Personal Information' (length=20)
        public 'field_format' =&gt; string 'vertical' (length=8)
        public 'status' =&gt; string '1' (length=1)
  </code></pre>
  
  <p>and the php code</p>
  
  <pre><code>       foreach ($query-&gt;result() as $row) {
              $data[] = $row;
           }
          var_dump($data);
          return $data;
  </code></pre>
  
  <p>i would like to add key [fields] and value string to it.</p>