Insert After X Number of Rows


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. $i = 1;
  3. while ($x < 17){
  4. echo 'Data ' . $i . '<br>';
  5.  
  6. //Change Value to how many rows you want to insert after.
  7. if( ($i % 3) == 0 ){
  8. echo 'Snippet of text--<br>';
  9. }
  10.  
  11. $i++;
  12. $x++;
  13. }//while
  14. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.