note 105616 deleted from function.ob-implicit-flush by danbrown
| From: | danbrown@php.net | Date: | Thu, 01 Sep 2011 20:25:50 +0000 |
| Subject: | note 105616 deleted from function.ob-implicit-flush by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182890@lists.php.net to get a copy of this message | ||
Note Submitter: bmw5002 at optonline dot net
----
I found this on stackoverflow.com: http://stackoverflow.com/questions/3133209/how-to-flush-output-after-each-echo-call/4978809#4978809
This code works for flushing the output buffer without explicitly calling flush after every echo. I
found that the real trick here is filling the output buffer to the minimum size required to flush.
Example:
ob_implicit_flush(1);
for($i=0; $i<10; $i++){
echo $i;
//this is for the buffer achieve the minimum size in order to flush data
echo str_repeat(' ',1024*64);
sleep(1);
}