note 56951 added to function.flush
| From: | php-general at lists dot php dot net | Date: | Tue, 20 Sep 2005 07:37:08 +0000 |
| Subject: | note 56951 added to function.flush | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-95453@lists.php.net to get a copy of this message | ||
In my testing, Internet Explorer 6.0 wouldn't flush anything nested in <table> or
<td> tags, regardless of padding. But at the <body> level everything flushed with no
fuss -- no padding or tags required.
Both Firefox 1.0 and Safari 2.0 could flush within tables, and both required a tag after the text
(like <br>). Safari could flush only after the first 1024 characters where received. Firefox
needed at least 8 characters per flush (but it could flush anything at the <body> level).
So the only thing that worked on all those browsers was this:
<html>
<body>
<?php // not in table tags for IE
echo str_pad('',1024); // minimum start for Safari
for ($i=10; $i>0; $i--) {
echo str_pad("$i<br>\n",8);
// tag after text for Safari & Firefox
// 8 char minimum for Firefox
flush(); // worked without ob_flush() for me
sleep(1);
}
?>
</body>
</html>
----
Manual Page -- http://www.php.net/manual/en/function.flush.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56951
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56951&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56951&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56951&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56951&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56951&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+56951&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56951&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56951&report=yes
Search -- http://master.php.net/manage/user-notes.php