ob_end_clean
ob_end_clean
Clean (erase) the contents of the active output buffer and turn it off
bool **ob_end_clean**
This function calls the output handler
(with the and
flags),
discards it's return value,
discards the contents of the active output buffer
and turns off the active output buffer.
PHP_OUTPUT_HANDLER_CLEAN``PHP_OUTPUT_HANDLER_FINAL
will fail
without an active output buffer started with the
flag.
ob_end_clean``PHP_OUTPUT_HANDLER_REMOVABLE
will discard the contents of the active output buffer
even if it was started without the
flag.
ob_end_clean``PHP_OUTPUT_HANDLER_CLEANABLE
return.success
If the function fails it generates an .
E_NOTICE
The following example shows an easy way to get rid of the contents of the active output buffer:
Voorbeeld: example
<?php
ob_start();
echo 'Text that won\'t get displayed.';
ob_end_clean();
?>
ob_start``ob_get_contents``ob_clean``ob_get_clean``ob_end_flush