I\'ve tried several attempts at getting my flush and ob_flush to work. I\'ve tried setting the ini to allow buffering, I\'ve tried using several different functions I found
This question seems to pop up a lot on a Google search, so I wanted to update it. It's September 2014.....
@Netcoder 's answer does work, but Chrome will sometimes still output everything all at once.
To fix this, simply added an ob_flush(), and flush() in the code, it will output after each second.
Example:
ob_implicit_flush(true);
ob_end_flush();
for ($i=0; $i<5; $i++) {
echo $i.'
';
ob_flush();
flush();
sleep(1);
}