Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Output Control Functions : ob_get_clean

ob_get_clean

Get current buffer contents and delete current output buffer (PHP 4 >= 4.3.0, PHP 5)
string ob_get_clean ( )

Example 1685. A simple ob_get_clean() example

<?php

ob_start
();

echo
"Hello World";

$out = ob_get_clean();
$out = strtolower($out);

var_dump($out);
?>

The above example will output:

string(11) "hello world"

Code Examples / Notes » ob_get_clean

webmaster

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

Change Language


Follow Navioo On Twitter
flush
ob_clean
ob_end_clean
ob_end_flush
ob_flush
ob_get_clean
ob_get_contents
ob_get_flush
ob_get_length
ob_get_level
ob_get_status
ob_gzhandler
ob_implicit_flush
ob_list_handlers
ob_start
output_add_rewrite_var
output_reset_rewrite_vars
eXTReMe Tracker