Reputation: 3089
Does anyone know how to output stuff I echo to a browser while the script is running?
I have a long loop that I'd like to output a string after every run of the loop, kind of like a progress bar, does anyone know how to do that?
Upvotes: 2
Views: 3564
Reputation: 163228
Use the ob_flush()
function:
ob_start();
//echo stuff...
ob_flush();
//echo more stuff...
ob_flush();
Upvotes: 4