I have 2 loops Inner Loop & Outer Loop.
When Outer loops reaches its third iteration, then inner loop should run. and i do like this.
<?php
foreach($this->posts as $post){
?>
<div id="post">
</div>
<?php
foreach($this->domain_ads as $ads) {
if($i%3==0){
?>
<div id="ads">
</div>
<?php }
} ?>
<?php
}
?>
And the Results are like this
Problem:
The problem is that inner loop shows all results after 3rd iteration. But i want to show only one result of inner loop, and then second result of inner loop should show after next 3 iterations of outer loop.
How can i solve this problem ?

$this->domain_ads[0]insted of foreach?