note 49102 deleted from function.apache-request-headers by tularis
| From: | tularis@php.net | Date: | Sun, 16 Jan 2005 22:35:16 +0000 |
| Subject: | note 49102 deleted from function.apache-request-headers by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-83469@lists.php.net to get a copy of this message | ||
Note Submitter: Pedro
----
I was writing some open source stuff and I needed to check if the user had enabled a GZIP
compression class I wrote. Here goes:
<?php
$headers = apache_request_headers();
$gzip = ereg("gzip", $headers['Accept-Encoding']) ? "Enabled" :
"Disabled";
echo("GZIP: <strong>" . $gzip . "</strong>.");
?>
Which will return either:
GZIP: <strong>Enabled</strong>.
Or
GZIP: <strong>Disabled</strong>.
Hope this helps someone.