How can I increment a value in a foreach loop for every 50 times the loop runs.
<?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
}
?>