PHP Dokumentation: Function ob-get-flush
12. Januar 2010 von werner
ob_get_flush
(PHP 4 >= 4.3.0, PHP 5)
ob_get_flush — Flush the output buffer, return it as a string and turn off output buffering
Beschreibung
string ob_get_flush ( void )
ob_get_flush() flushes the output buffer, return it as a string and turns off output buffering.
Hinweis: This function is similar to ob_end_flush(), except that this function returns the buffer as a string.
Rückgabewerte
Returns the output buffer or FALSE if no buffering is active.
Beispiele
Beispiel #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());
?>Das oben gezeigte Beispiel erzeugt folgendeAusgabe:
Array( [0] => default output handler)Array()
Siehe auch
- ob_end_clean() – Löscht den Ausgabe-Puffer und deaktiviert die Ausgabe-Pufferung
- ob_end_flush() – Leert (schickt/sendet) den Ausgabe-Puffer und deaktiviert die Ausgabe-Pufferung
- ob_list_handlers() – List all output handlers in use