The output buffer handler function is a bit like the C stack, which is temporarily placed in a storage space to process the content.
The output buffer functions are:
Ob_start ()- open output control buffer
Ob_get_length ()-Returns the length of the output buffer
Ob_get_level ()-Returns the nesting level of the output buffer
Ob_get_status ()-Returns the state of the output buffer (returned as an array, returning the topmost layer by default, all when the parameter is true)
Ob_get_contents ()-Returns the contents of the output buffer
Ob_get_clean ()-Returns the current output buffer in string format and turns off output buffering
Ob_end_clean ()-Empty (erase) buffer and turn off output buffering
Ob_get_flush ()-Returns the output buffer content as a string and closes the buffer
Ob_end_flush ()-Flush out (send out) output buffer content buffer
Examples are as follows:
<?php define (' App_root ', DirName (FILE)); $file = '/templates/html/error_ Config.html '; Ob_start (); Include (App_root. $file); Ob_end_flush (); $contents = Ob_get_contents (); This allows the output to be saved for further processing//ob_end_clean (); echo $contents;?
<?php echo "<?xml version=\" 1.0\ "encoding=\" utf-8\ ">";?> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
The output results are as follows:
Config.php does not exist or isn't readable by the webserver in the Phpsysinfo directory.