note 55232 added to function.flush
| From: | php-general at lists dot php dot net | Date: | Thu, 28 Jul 2005 06:07:12 +0000 |
| Subject: | note 55232 added to function.flush | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-92610@lists.php.net to get a copy of this message | ||
Apparently Opera (tested with versions 8.01) won't flush before a <br> is received. MSIE
and Firefox can display dotted progress with following code:
<?php
echo str_pad("Processing", 4096) . "\n";
for ($i = 0; $i<10; $i++){
echo str_pad(".", 4096) . "\n";
ob_flush();
flush();
sleep(2);
}
?>
So output is something like: Processing.....
Opera doesn't work with this. echo lines must be changed to:
<?php
echo str_pad("Processing<br>", 4096) . "\n";
?>
and
<?php
echo str_pad(".<br>", 4096) . "\n";
?>
So output is like:
Processing
.
.
.
.. which is not so nice. Anyone know's how to make Opera also flush without <br>?
----
Manual Page -- http://www.php.net/manual/en/function.flush.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55232
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55232&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55232&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55232&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55232&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55232&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55232&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55232&report=yes
Search -- http://master.php.net/manage/user-notes.php