Is there any way for all my PHP and/or HTML file output to be \"filtered\" before being displayed in the browser? I figured that I could pass it through a global function b
You can use PHP's output buffering functions to do that
You can provide a callback method that is called when the buffer is flushed, like:
It's like comparing apples to oranges.
In that case output is buffered instead of sent from the script and just before the flush your callback method is called.