Description:
I have a script which do multiple actions in longer time. In standard situation output from PHP script is sent after full execution of this script. User may be dissapointed if my script will load very long time without any response.
Problem to solve:
Let's say I have in this script a loop which will be working 10 times.
After each one execution I want to get output to browser "Element X finished. Y time."
. Value of X and Y will be changing.
Question:
Is there any way to reach that effect? Maybe with some kind of call from this script to new script which will sent data to browser throug AJAX.
Or is there any way to reach this effect only with PHP implementation?
EDIT:
I see that I have to clarify the matter. I want this information to appear dynamically on the page. I tried with output buffer functions already, and it still don't work as I need it. Output in browser is showing after full execute of script. Test code:
for ($i = 0; $i <= 10; $i++) {
ob_start();
echo "Output " . $i . "<br />";
ob_flush(); //also only flush() etc.
sleep(1);
}