title: PHP Foreach Arrays and objects
body: <p>I have an array of objects; running <code>print_r()</code> returns the output below;</p>
  <pre class="lang-php prettyprint-override"><code>Array
  (
      [0] =&gt; stdClass Object
          (
              [sm_id] =&gt; 1
              [c_id] =&gt; 1
          )
      [1] =&gt; stdClass Object
          (
              [sm_id] =&gt; 1
              [c_id] =&gt; 2
          )
  )
  </code></pre>
  <p>How to loop through the result and access the student class objects?</p>