ob_start();
for($i=0; $i < 10; $i++) {
echo $i, ' ';
ob_flush();
flush();
sleep(1);
}
Expected: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 appearing incrementally every second in the browser.
Result: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 at once AFTER ten seconds.
I just couldn't get output buffering to work.