Output buffering catches all echo-s, print-s and other output to stdOut. Then you can call a function on script shutdown to output all of the content. You can buffer output and stop scripts from output for an example.
Source code viewer
// Turn output buffering on. // Called on the end of script iterations. function shutdown() { // Print all buffered output. }Programming Language: PHP