I have a foreach loop like this
$sn_count = 1;
$html = '';
foreach($points as $point){
$html .= "<div class=\"points\">"
. "<div class=\"serial\">".$sn_count."</div>"
. "<div class=\"pointsdesc\">"
. $point['points_description']
. "</div></div>";
$sn_count++;
}
echo $html;
This code output is like this
1
First point description
2
second point description
etc…
Now i want to display ads after every 2,4,6,… points. I mean in-between 2-3,4-5,6-7,…
Can anyone help me with the code?
Thanks
You’ll want to use the modulus