ob_get_length
Returns the length of the output buffer
ob_get_length()
function returns the length (in bytes) of the top-most output buffer content. This is not always the same as the number of characters, as some characters may take up more than one byte.
Displays the number of characters in the output buffer:
<?php ob_start ( ) ; echo "Hello World!" ; $length = ob_get_length ( ) ; ob_end_clean ( ) ; echo "The content of the buffer is $length bytes long" ; ?>
Try it yourself
ob_get_length ( ) ;