In my webpage when I click on the button, the request goes through ajax on my server on php file. Below is the php file.
Now as you can see that it has many echo statements, so while the server is processing data my webpage has to wait while php file completes its processing.
Is there any technique by which handle each echo statement simultaneously?
Meaning, I don't need to wait for whole response and I can append each part of the response to my webpage.
<?php
$i = 0;
while($i<1000000){
echo $i;
$i++;
}
?>