note 17239 added to function.flush

From: Date: Fri, 30 Nov 2001 20:14:23 +0000
Subject: note 17239 added to function.flush
Groups: php.notes 
Request: Send a blank email to php-notes+get-21493@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(); } ?> -- http://www.php.net/manual/en/function.flush.php http://master.php.net/manage/user-notes.php?action=edit+17239 http://master.php.net/manage/user-notes.php?action=delete+17239 http://master.php.net/manage/user-notes.php?action=reject+17239

« previous php.notes (#21493) next »