PHP ob_get_flush() Function

PHP ob_get_contents() Function
PHP ob_get_length() Function

In this article, you will learn how to get or print the contents of the output buffer currently being at the top of the stack. The ob_get_flush() function in PHP outputs the contents of the topmost output buffer, returns the contents, and deletes the buffer. 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_GET_FLUSH() function in php?

ob_get_flush();

examples of the OB_GET_FLUSH() function

Example 1. In this example, we store the contents of an output buffer in a variable.

<?php
ob_start();
echo "Hello World!";
$contents = ob_get_flush();

echo "<br>";
echo "The contents of the buffer were: ";
echo $contents;
?>
PHP ob_get_contents() Function
PHP ob_get_length() Function
en English
X
Scroll to Top