PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Here a better description what I want to realize.
When creating a PDF file I want to check if I must send the Content-Length: or not.
Something like this, but then with web server deflate and gzip detection:
if (ini_get('zlib.output_compression') == false)
{
// Content_Length is not correct when GZIP is enabled
header('Content-Length: ' . strlen($buffer));
}
This is a cut down version from the gzip output filter in my Template Lite package. It will check to see if the library is loaded and if the server has it enabled by default. You don't want it to compress twice if the server has auto compression enabled. Plus, the last check is to see if the browser supports gzip.