I just saw a link on here with pretty much the same issue I had, but I want to make sure I understand. Here's the link: what is the role of ob_start() in here
So, his code had no real "output" -- no echos, no html, pretty much nothing. But he had an ob_start in it. Mine, like his, is legacy code and mine has NO output in it. All it does is update some tables. All of the answers I saw in this link addressed the actual function of the ob_start - I think only one addressed his real question, which was "what is the role of ob_start in THIS code?". So, if the code is a 'behind the scenes' script that is NOT outputting html or echoes or anything else, isn't the output buffer stuff useless? Thanks
No, it's not entirely useless, because the code there can still produce output through errors.
One of the answers already addressed this:
In that specific code, there shouldn't be any output, but that doesn't mean that there can't be or that it would be easy to screw up and add output. Errors, warnings, and notices from any function call can add output if
display_errors
is on. There are many various ways of producing output in PHP and so anob_start
stops them all from actually sending that output to the response.As said above, you might want to do this in order to: