note 57030 added to function.ob-flush
| From: | php-general at lists dot php dot net | Date: | Thu, 22 Sep 2005 01:37:19 +0000 |
| Subject: | note 57030 added to function.ob-flush | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-95570@lists.php.net to get a copy of this message | ||
I was having problems with output buffering which seemed to be active by default on the server,
although phpinfo said something else..
In any case I needed to know that when I ran ob_start, it would start at the top level, so I could
use ob_flush as it's intended without having to call multiple ob_flush in-script - this is what
I did:
<?php
// make sure output buffering is off before we start it
// this will ensure same effect whether or not ob is enabled already
while (ob_get_level()) {
ob_end_flush();
}
// start output buffering
if (ob_get_length() === false) {
ob_start();
}
?>
Then I could call ob_flush(); followed by flush(); and get the output I wanted, which I didn't
if I started the script with just ob_start();
This was on a windows apache 2 server with php 5.0.4 btw.
----
Manual Page -- http://www.php.net/manual/en/function.ob-flush.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57030
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57030&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57030&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57030&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57030&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57030&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57030&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57030&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57030&report=yes
Search -- http://master.php.net/manage/user-notes.php