title: What's the difference between while() and for()?
body: <p>Maybe my question seems primary, But actually it is not. I claim that I can do <strong>everything</strong> is done with <code>for()</code> by <code>while()</code>, And conversely. So really when <code>while()</code> is useful when there is <code>for()</code>? I need to a example that I can do that by <code>for()</code> and I can not do that by <code>while()</code>. There is? I think there is not ...!</p>
  
  <p>Here is the structure:</p>
  
  <pre><code>for (init counter; test counter; increment counter) {
      code to be executed;
  }
  
  
  init counter;
  while (test counter) {
      code to be executed;
      increment counter;
  }
  </code></pre>
  
  <p>see? they are exactly the same, Now I want to know why <em>php</em> has both of them? </p>