Display output in parts in PHP

Disable all output buffering and pad the output:

while(@ob_get_clean());

for($i = 0; $i<30; $i++)
{
    echo str_pad("$i<br>",4096);          
    usleep(100000); 
}

Also, this won’t work, if your Apache is using mod_deflate and you have gzip-compression for text/html files.

Leave a Comment