Current Location: Home> Function Categories> ob_clean

ob_clean

Clear (erase) the output buffer
Name:ob_clean
Category:Output buffer control
Programming Language:php
One-line Description:Delete everything in the topmost output buffer.

Definition and usage

ob_clean() function deletes all contents of the top-most output buffer to prevent them from being sent to the browser.

Example

Remove some output before sending to the browser:

 <?php  
ob_start ( ) ;  
echo "This part of the output will not be sent to the browser" ;  
ob_clean ( ) ;  
echo "This part of the output will be sent to the browser" ;  
ob_end_flush ( ) ;  
?>

Try it yourself

grammar

 ob_clean ( ) ;
Similar Functions
Popular Articles