gple Posted May 26, 2007 Share Posted May 26, 2007 Is there any way to pause inside a loop? If I want to pause for 1 second between each output, is that possible Link to comment https://forums.phpfreaks.com/topic/53050-pausing-script/ Share on other sites More sharing options...
taith Posted May 26, 2007 Share Posted May 26, 2007 sleep(1); Link to comment https://forums.phpfreaks.com/topic/53050-pausing-script/#findComment-262058 Share on other sites More sharing options...
AndyB Posted May 26, 2007 Share Posted May 26, 2007 sleep() pauses execution of a script. If you want to pause output to the browser, you need something like: <?php ob_start(); for ($i=1;$i<10;$i++) { echo $i. "<br/>"; sleep(1); // pause 1 second ob_flush(); flush(); } ?> Link to comment https://forums.phpfreaks.com/topic/53050-pausing-script/#findComment-262059 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.