GoLang ob_get_flush

request it (465)
GoLang replacement for PHP's ob_get_flush [edit | history]



Do you know a GoLang replacement for PHP's ob_get_flush? Write it!

PHP ob_get_flush

PHP original manual for ob_get_flush [ show | php.net ]

ob_get_flush

(PHP 4 >= 4.3.0, PHP 5, PHP 7)

ob_get_flushFlush the output buffer, return it as a string and turn off output buffering

Description

string ob_get_flush ( void )

ob_get_flush() flushes the output buffer, return it as a string and turns off output buffering.

The output buffer must be started by ob_start() with PHP_OUTPUT_HANDLER_FLUSHABLE flag. Otherwise ob_get_flush() will not work.

Note: This function is similar to ob_end_flush(), except that this function also returns the buffer as a string.

Return Values

Returns the output buffer or FALSE if no buffering is active.

Examples

Example #1 ob_get_flush() example

<?php
//using output_buffering=On
print_r(ob_list_handlers());

//save buffer in a file
$buffer ob_get_flush();
file_put_contents('buffer.txt'$buffer);

print_r(ob_list_handlers());
?>

The above example will output:

Array
(
    [0] => default output handler
)
Array
(
)

See Also