Forum Moderators: coopster
<?php
function callback($buffer)
{
// replace all the apples with oranges
return (str_replace("apples", "oranges", $buffer));
}
ob_start("callback");
?>
<html>
<body>
<p>It's like comparing apples to oranges.</p>
</body>
</html>
<?php>
ob_end_flush();
?>
combined with:
<?php
ob_start("ob_gzhandler");
?>
<html>
<body>
<p>It's like comparing apples to oranges compressed page.</p>
</body>
</html>
Note: You cannot use both ob_gzhandler() and zlib.output_compression [php.net]. Also note that using zlib.output_compression is preferred over ob_gzhandler().Resource:
[php.net...]