title: Show an advert within loop CakePHP
body: <p>If I have the following code:</p>
  
  <pre><code>&lt;?php foreach ($posts as $post): ?&gt;
  
  &lt;li&gt;POST&lt;/li&gt;
  
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>How would I show an advert in between the posts say every 5 items or just once after 5 items?</p>
  
  <p>I thought about something like <code>$post[5]</code> but not sure if I'm barking up the wrong tree. Any suggestions/feedback and examples would be appreciated.</p>