PHP ob_end_clean() Function

P
PHP ob_clean() Function
PHP ob_flush() Function

In this article, you will learn how to delete the output buffer and all of its contents. The buffer to be deleted is the one present at the top of the stack. The ob_end_clean() function in PHP deletes the topmost output buffer and all of its contents without sending anything to the browser.

what is the syntax of the OB_END_CLEAN() function in php?

ob_end_clean();

examples of the OB_END_CLEAN() function

Example 1. In this example, we 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";
?>
PHP ob_clean() Function
PHP ob_flush() Function

Add comment

Tutor Network

Share this

Learn PHP from A to Z