I'm using PHP to perform a fairly big process, which takes a while. I'm concerned that it has the tendency to buzz away forever on the server side and then finally output everything all at once. I would prefer it to output the page in 'stages' so the user gets some feedback.
Is there any way to force a PHP script to send its output 'so far' and then send another lot later, and another lot later, without stopping and restarting the script?
Something reminiscent of:
Code: Select all
$line = "A small dog\n";
send_it( $line );
$line = "called Bernard\n";
send_it( $line );
$line = "gave Sally\n";
send_it( $line );
$line = "a nip!\n";
send_it( $line );
Thoughts?