I’m having issues with ob_start. Not sure what the deal is, but I’ve bubbled it down to the simplest possible test case… still to no avail. I would expect this code to output ‘bar’ to the stdout, but I’m getting nothing back, and no errors in my error log.
<?php
function gzhandler_ex($buffer, $mode)
{
echo 'bar';
}
ob_start('gzhandler_ex');
echo 'foo';
ob_flush();
I’ve never seen this before, but I don’t typically use callbacks like this.
Your handler function should
returnthe content you want to output, not echo it.Also, the
ob_flush()is unnecessary when called at the end of the script; it is implicit.