Home > Article > Backend Development > About the enhanced use of callback ob_start() function_PHP tutorial
Question
About the enhanced use of callback functions.
Solution
When the program structure is complex, with many introductions and irregular references. If there is an echo 'aaaa'; in a certain file, it will affect the program output.
function ob_gzip($content)
How to determine if the program has echo print and any non-html output in such a callback function?
Reference answer
Try not to output content in the callback function. My common.class.php file of more than ten kilobytes does not even have a space in it to avoid problems when calling.
Reference answer
Make regular quotes.
Single entrance, shallow structure
Reference answer
I want to limit the echo output... It must be output in html... to ensure that the program can be executed under healthy conditions...
Reference answer
ob_start()
This is what we do
Reference answer
Write a function for me...
Reference answer
The grass bird learned
Reference answer
Hahaha, learned
Reference answer
Just start the file directly ob_start(); and that’s it
Reference answer
ob_start(); Now I have it, but I still can’t tell when the echo occurs and how to abort it..