I'm trying to display a list of email addresses from a text file, using the flush script below. It should display one email address every second (1 sec sleep) until the entire list is shown.
It works ok to display the static message seen below, but I cannot get it to display the emails from the text file. Got any ideas?
Sample email list:
John@whatever.net
jane@whatever.net
jim@whatever.net
Jenny@whatever.net
<?php
if (ob_get_level() == 0) ob_start();
for ($i = 1; $i<10; $i++){
echo "<br> $i Line to show.";
echo str_pad('',4096)."\n";
ob_flush();
flush();
sleep(1);
}
echo "<br> Done.";
ob_end_flush();
?>