title: Increment int var every 10 iterations of loop
body: <p>I'm building a long query of dummy data. I have a for loop running a few thousand times, in each loop, it adds a new row to a query, with the increment variable used for dummy file names, 1.png, 2.png etc. I also need to increment a separate foreign key id, but it needs to only be every 10 iterations of the loop. can anyone help? Thanks.</p>
  
  <pre><code>$var = '';
  for($i=0;$i&lt;100;$i++){
      $path = '/test' . $i . '.pdf';
      $mess = 'Test message '. substr(md5($i), 0, 10);
      $did = 0;//How to increment this var by 1 every 10 iterations?
      $var .= "INSERT INTO `message` (`design_id`, `path`, `message`) VALUES ('$did', '$path', '$mess');"."&lt;br /&gt;";
  }
  echo $var;
  </code></pre>