PHP ob_flush() Function

PHP ob_end_clean() Function
PHP ob_end_flush() Function

In this article, you will learn how to get the contents of the buffer currently at the top of the stack and then clear the buffer contents. The ob_flush() function in PHP outputs the contents of the topmost output buffer and then clears the buffer of the contents. The output may be caught by another output buffer or, if there are no other output buffers, sent directly to the browser.

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

ob_flush();

examples of the ob_flush() function

Example 1. In this example, we output the contents of a buffer without deleting it.

<?php
ob_start();
echo "This output will be sent to the browser";
ob_flush();
echo "This output will not be sent to the browser";
ob_end_clean();
?>
PHP ob_end_clean() Function
PHP ob_end_flush() Function

Stay up-to-date about PHP!

We don’t spam!

en English
X
Scroll to Top