|
ob_get_clean
Get current buffer contents and delete current output buffer
(PHP 4 >= 4.3.0, PHP 5)
Gets the current buffer contents and delete current output buffer. ob_get_clean() essentially executes both ob_get_contents() and ob_end_clean(). Return Values
Returns the contents of the output buffer and end output buffering.
If output buffering isn't active then ExamplesExample 1685. A simple ob_get_clean() example<?php The above example will output: string(11) "hello world"
See Also
Code Examples / Notes » ob_get_cleanwebmaster
Running PHP4 < 4.3.0, you can simply add the following to use the function anyway: <?php if (!function_exists("ob_get_clean")) { function ob_get_clean() { $ob_contents = ob_get_contents(); ob_end_clean(); return $ob_contents; } } ?> ludvig dot ericson
Notice that the function beneath does not catch errors, so throw in an @ before those ob_* calls
|