title: Php: how to print each result after a second of delay
body: <p>I want something like:</p>
  
  <pre><code>for($k=0;$k&lt;20;$k++){
      echo $k;
  }
  </code></pre>
  
  <p>Output: </p>
  
  <p>0</p>
  
  <p>Sleep for 1 second.</p>
  
  <p>1</p>
  
  <p>sleep for 1 second.</p>
  
  <p>2</p>
  
  <p>sleep for 1 second.</p>
  
  <p>.</p>
  
  <p>.
  .</p>