note 17239 deleted from function.flush by jimw

From: Date: Sat, 08 Dec 2001 23:30:45 +0000
Subject: note 17239 deleted from function.flush by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-22338@lists.php.net to get a copy of this message
It would appear that a flush() command will work after the first 256 bytes are transmitted. Here is an example that works under Linux of a 10 second progress bar that doesn't need to send a 300 byte string before every flush.. <?php // create a string long enough to fill the buffer... $long_str = str_repeat( " ", 300 ); // 300 should do it. // output the string and make IE happy :) echo $long_str;flush(); for($i = 1; $i < 11; $i++){ for( $d = 0; $d < 5; $d ++ ){ echo "."; usleep(200000); flush(); // this flush should now work even though I am only flushing 1 byte. } echo $i; flush(); } ?>

« previous php.notes (#22338) next »