I have a loop that takes very long to execute, and I want the script to display something whenever the loop iteration is done.
echo "Hello!";
flush();
for($i = 0; $i < 10; $i ++) {
echo $i;
//5-10 sec execution time
flush();
}
This does not display the echos until the entire script is completed. What went wrong?
See Question&Answers more detail:os