Creating a Content-Length Header
A simple way of creating a content-length header using output buffering:
<?php // php code. ob_start(); ?> <!-- HTML tag and the rest of content. --> <?php header('Content-Length: '. ob_get_length()); ob_end_flush(); ?>