Usage of the following three functions
ob_get_contents();
ob_end_clean();
ob_start();
You can use these functions to buffer local files and execute local script code.
Use ob_start() to save the output code into the buffer, and the page will not be displayed;
Then use ob_get_contents to get the buffer data.
ob_start() opens a buffer on the server to hold all output.
So anytime echo is used, the output will be added to the buffer until the program ends or is terminated using ob_flush().
Then the content of the buffer in the server will be sent to the browser, which will be parsed and displayed by the browser.
The function ob_end_clean clears the contents of the buffer and closes the buffer, but does not output the contents.
At this time, a function ob_get_contents() must be used in front of ob_end_clean() to obtain the contents of the buffer.
In this case, the content can be saved to a variable before executing ob_end_clean(), and then the variable can be operated after ob_end_clean().
This is EG
ob_start();//buf1
echo'multiple';
ob_start();//buf2
echo'bufferswork';
$buf2 = ob_get_contents();
ob_end_clean();
$buf1 = ob_get_contents();
ob_end_clean();
echo$buf1;
echo'<br/>';
echo$buf2;