PHP ob_end_clean() Function

❮ PHP Output Control Functions

Example

Delete an output buffer without sending its contents to the browser:

<?php
ob_start();
echo "This output will not be sent to the browser";
ob_end_clean();
echo "This output will be sent to the browser";
?>
Try it Yourself »

Definition and Usage

The ob_end_clean() function deletes the topmost output buffer and all of its contents without sending anything to the browser.


Syntax

ob_end_clean();

Technical Details

Return Value: Returns true if the operation was successful or false if it failed
PHP Version: 4+

❮ PHP Output Control Functions
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.