How do i output to the browser before the script finishes executing?
For example, the code below will output all 100 \"hi\" at once, how do I make it so it will outp
Call ob_implicit_flush() before your loop.
Note that this is not a guarantee (web server buffers, proxy buffers and web browsers who refuse to rerender are your enemy). It MAY help to echo some linefeeds (\n) as I seem to remember that there are browsers who will not rerender until they received a complete line.
This will not work at all if you use output buffering (e.g. for compression using gzip (if the gzip modul you use uses buffering which is not uncommon) or other reasons).