Pyh.conf’25: a new PHP conference for the Russian-speaking community

Voting

: max(six, eight)?
(Example: nine)

The Note You're Voting On

tehjosh at gamingg dot net
17 years ago
faisun at sina dot com:
If you read up on output buffering, you'll see that if an output buffer callback returns false, this instructs PHP to output the original string untouched. That's why ob_gzhandler() returns false if the encoding is not supported. When ob_start("ob_gzhandler") is used and encoding is not supported, ob_gzhandler() will return false and PHP outputs the original, uncompressed string.

jsnell at e-normous dot com:
Output buffering callback functions accept up to two parameters, so this would probably work better for your situation:

<?php
function ob_gz_handler_no_errors($buffer, $mode)
{
@
ob_gzhandler($buffer, $mode);
}

ob_start('ob_gzhandler_no_errors');
?>

However, if you're trying to suppress errors caused by headers already being sent, it would be better to start the output buffering earlier, before any output can be sent.

<< Back to user notes page

To Top