ob_get_flush

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

&reftitle.description; ``string``false```ob_get_flush`

`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.

This function is similar to `ob_end_flush`, except that this function also returns the buffer as a string.

&reftitle.parameters; &no.function.parameters;
&reftitle.returnvalues;

Returns the output buffer or &false; if no buffering is active.

&reftitle.examples;

### `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());
    ?>

&example.outputs;

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

&reftitle.seealso;

- `ob_end_clean`
- `ob_end_flush`
- `ob_list_handlers`