title: How to get partial output when script is executing?
body: <h3>Description:</h3>
  <p>I have a script which do multiple actions in longer time. In standard situation output from PHP script is sent after full execution of this script. User may be dissapointed if my script will load very long time without any response.</p>
  <h3>Problem to solve:</h3>
  <p>Let's say I have in this script a loop which will be working 10 times.
  After each one execution I want to get output to browser <code>&quot;Element X finished. Y time.&quot;</code>. Value of X and Y will be changing.</p>
  <h3>Question:</h3>
  <p>Is there any way to reach that effect? Maybe with some kind of call from this script to new script which will sent data to browser throug AJAX.</p>
  <p>Or is there any way to reach this effect only with PHP implementation?</p>
  <h3>EDIT:</h3>
  <p>I see that I have to clarify the matter. I want this information to appear dynamically on the page. I tried with output buffer functions already, and it still don't work as I need it. Output in browser is showing after full execute of script. Test code:</p>
  <pre><code>for ($i = 0; $i &lt;= 10; $i++) {
      ob_start();
          
      echo &quot;Output &quot; . $i . &quot;&lt;br /&gt;&quot;;
          
      ob_flush(); //also only flush() etc.
      
  
      sleep(1);
  }
  </code></pre>