I'm trying to delay execution of a loop as follows:
for($i=0; $i<10; $i++) {
echo $i;
flush();
sleep(5);
}
Each iteration should should be 5 seconds apart.
However, I want the result sent out at the end of each iteration.
The above only sends the result after the last iteration.
Kindly offer suggestions.
Thanks.