Using flush() replace last line rather than make new one in php
Lets say my php code is similar to below. . . $range = range(0, 5); foreach ($range as $times) { if (ob_get_level() == 0) ob_start(); for ($i = 0; $i<1; $i++){ echo "<br>example ".$times; echo str_pad('',4096)."\n"; ob_flush(); flush(); sleep(1.2); } ob_end_flush(); } What it displays is. . . example1 example2 example3 example4 example5 It waits a short period of time before showing the next line, I don't want to display all five at once, I want to replace example1 with the next one and so on for all five is this possible in php? any answers welcome You Would need to use javascript to replace