Puoi usare http://www.php.net/apache_request_headers se disponibile.