ob_get_length

(PHP 4 >= 4.0.2, PHP 5)

ob_get_length --  Return the length of the output buffer

Description

int ob_get_length ( void )

This will return the length of the contents in the output buffer or FALSE, if output buffering isn't active.

See also ob_start() and ob_get_contents().

br />//save buffer in a file
$buffer = ob_get_flush();
file_put_contents('buffer.txt', $buffer);

print_r(ob_list_handlers());
?>