Is this technically possible to make Response Generator by using PHP, AJAX, JS?
For example:
// php
foreach(range(0,1000,100) as $range) {
yieldResponse('My range is: $range <br>');
sleep(1);
}
Browser user would see this response:
My range is: 0
After 1 second:
My range is: 0
My range is: 100
After 5 seconds:
My range is: 0
My range is: 100
My range is: 200
My range is: 300
My range is: 400
My range is: 500
In other words:
Is this possible to send parts of responses in loop before end of php script and without stop this scripts?