note 25496 added to function.flush
| From: | mikael at rack1 dot php dot net | Date: | Wed, 25 Sep 2002 22:50:53 +0000 |
| Subject: | note 25496 added to function.flush | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37252@lists.php.net to get a copy of this message | ||
I wanted to flush the page in a loop (making several fopen connections to test if links are valid).
Neither flush() nor ob_flush() worked, but TOGETHER they work.
I use Apache 1.3 and PHP 4.2.3, IE6SP1 or NC4.78
The flushing is also a little different between the two browsers. NC seem to flush row-wise, where
IE flushes (as told) after each URL is printed (see below).
Example ($urlsArray holds a number of URLs to be tested):
foreach( $urlsArray as $value ) {
echo( $value );
ob_flush();
flush();
if( $fp = @fopen( $value, 'r' ) ) {
echo( ' - OK' . "\n" );
fclose( $fp );
} else {
echo( ' - <b>FALSE!</b>' . "\n" );
}
}
--
http://www.php.net/manual/en/function.flush.php
http://master.php.net/manage/user-notes.php?action=edit+25496
http://master.php.net/manage/user-notes.php?action=delete+25496
http://master.php.net/manage/user-notes.php?action=reject+25496