Jump to content

print php lines with delay in between


elitegosu

Recommended Posts

Hi, I have a really newbie question. How do I print my text within a delay inside the loop?

 

For example:

 

for ($i=0;$i<=10;$i++) {

echo "this is line: ".$i."<br />";

}

 

I want to print one line and then have a one second delay and then print the next one and so on....I tried sleep(1) function after print line within the loop, but it waits 10 seconds instead (going through the whole loop) and only then printing everything at once. How do I make it print one line at a time with a one second delay in between?

Link to comment
https://forums.phpfreaks.com/topic/151656-print-php-lines-with-delay-in-between/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.