title: How to output a value on every third result of a foreach statement in php?
body: <p>I have a <code>foreach</code> statement in my app that echos a list of my database results:</p>
  
  <pre><code>&lt;?php
  
  foreach($featured_projects as $fp) {
    echo '&lt;div class="result"&gt;';
    echo $fp['project_name'];
    echo '&lt;/div&gt;';
  }
  
  ?&gt;
  </code></pre>
  
  <h2>I would like to:</h2>
  
  <p>On every third result, give the div a different class. How can I achieve this?</p>