PHP foreach loop every fifth item
<p>I have a simple foreach loop like:</p>

<pre><code>foreach ( $posts as $index =&gt; $posts )
</code></pre>

<p>and also a counter:</p>

<pre><code>if( $index % 5 + 1 == 5 ) {
//do something 
}
</code></pre>

<p>I have 15 posts per page and it should do something every fifth item but NOT on the last but how do I do that?</p>

<p>So it becomes:</p>

<pre><code>POST
POST
POST
POST
POST
DO SOMETHING
POST
POST
POST
POST
POST
DO SOMETHING
POST
POST
POST
POST
POST
</code></pre>
