title: Can I use while loop to loop through array of objects?
body: <p>This is where the code is at right now:</p>
  
  <pre><code>&lt;ul&gt;
      &lt;?php
      while ($themes = $model-&gt;getAllThemes()) {
          echo '&lt;li&gt;' . $themes-&gt;id . ' ' . $themes-&gt;title . '&lt;/li&gt;';
      }
      ?&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>The $themes array looks like this:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Theme Object
          (
              [id] =&gt; 11
              [title] =&gt; NewTheme
          )
  
      [1] =&gt; Theme Object
          (
              [id] =&gt; 12
              [title] =&gt; FakeTheme
          )
  )
  </code></pre>
  
  <p>When I test it, it goes in an infinite loop pretty much, so I'm guessing it doesn't know how long the array is? I'm trying to avoid having to count the items in the array and I'm pretty sketchy on foreach loop syntax.</p>