title: How can I increment by a value by 1 for every 50 times a foreach loop runs
body: <p>How can I increment a value in a foreach loop for every 50 times the loop runs. </p>
  
  <pre><code>&lt;?php
  
  $counter = 1; 
  foreach ($numbers as $num) {
        //For the first 50 times the loop runs, $counter = 1. For every 50 runs, increment by 1
  $counter = 1;
  
  //if loop has run more than 50 times, increment $counter to 2 
  
  
  }
  ?&gt;
  </code></pre>