title: The difference between loops
body: <p>It's about PHP but I've no doubt many of the same comments will apply to other languages.</p>
  
  <p>Simply put, what are the differences in the different types of loop for PHP? Is one faster/better than the others or should I simply put in the most readable loop?</p>
  
  <pre><code>for ($i = 0; $i &lt; 10; $i++)
  {
      # code...
  }
  
  
  foreach ($array as $index =&gt; $value)
  {
      # code...
  }
  
  
  do
  {
      # code...
  }
  while ($flag == false);
  </code></pre>