note 42939 added to function.ob-end-clean
| From: | JohnSmith at rn2 dot php dot net | Date: | Fri, 04 Jun 2004 08:39:12 +0000 |
| Subject: | note 42939 added to function.ob-end-clean | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70768@lists.php.net to get a copy of this message | ||
Note that if you started called ob_start with a callback, that callback will still be called even if
you discard the OB with ob_end_clean.
Because there is no way of removing the callback from the OB once you've set it, the only way
to stop the callback function from having any effect is to do something like:
<?php
$ignore_callback = false;
ob_start('my_callback');
...
if($need_to_abort) {
$ignore_callback = true;
ob_end_clean();
...
}
function my_callback(&$buffer) {
if($GLOBALS['ignore_callback']) {
return "";
}
...
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.ob-end-clean.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42939
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42939&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42939&report=yes
Search -- http://master.php.net/manage/user-notes.php