PHP: Flushes the system write buffers


We use function flush — Flush system output buffer

<?php

if (ob_get_level() == 0) ob_start();

for ($i = 1; $i<=10; $i++){
    echo "<br> Line $i.";     
    ob_flush();
    flush();
    sleep(2);
}

echo "Done.";

ob_end_flush();

?>

Leave a Reply