Hello friends, I need a solution for this: Suppose i have got 20 links from a query to display them in a column like link 1 link2 link3 ..... ..... link20 No problem up to this portion. But now i want to show a google ad after every 5th link like link1 ..... link5 google ad here link6 ..... link10 google ad here link11 ..... link15 google ad here link16 ..... link20 google ad here Any idea or solution? Thanks in advance
You can Try- <? $sl=1; for($a=1;$a<=23; $a++) { echo $a."<br>"; if(($sl/5)!=(is_float($sl/5))) { echo "Your Google Ad Here<br>"; } $sl=$sl+1; } ?> if fulfill your requirement, plz apply green repu
<?php $counter = 0; foreach ($yourlinks as $link) { echo $link.'<br />'; $counter++; if ($counter%5 == 0) echo $google_ad_code; } ?> PHP: