title: echo php foreach loop result by 3 different row data
body: <p>I have a foreach loop and my code looks this is:</p>
  
  <pre><code>$count =  count($testimonial)/3;
  for ($i = 1;$i &lt;= $count;$i++){
      echo '&lt;p&gt;Title&lt;/p&gt;';
      foreach ($testimonial as $data){
      echo $data-&gt;testimonial_title.'&lt;br&gt;';
     }
  }
  </code></pre>
  
  <p>This is the result:</p>
  
  <p><p>Title</p>aligned media one<br>aligned media one<br>aligned media one<br>Middle aligned media<br>Middle aligned media<br>Middle aligned media<br>media<br>media<br>media<br><p><br>Title</p>aligned media one<br>aligned media one<br>aligned media one<br>Middle aligned media<br>Middle aligned media<br>Middle aligned media<br>media<br>media<br>media<br><p><br>Title</p>aligned media one<br>aligned media one<br>aligned media one<br>Middle aligned media<br>Middle aligned media<br>Middle aligned media<br>media<br>media<br>media<br></p>
  
  <p>But i want something like this :</p>
  
  <p><p>Title</p>aligned media one<br>aligned media one<br>aligned media one<br><br><p>Title</p>Middle aligned media<br>Middle aligned media<br>Middle aligned media<br><p><br>Title</p><br>media<br>media<br>media<br></p>