Apache Functions
PHP Manual

apache_request_headers

(PHP 4 >= 4.3.0, PHP 5)

apache_request_headersدریافت تمام سرآیندهای درخواست HTTP

Description

array apache_request_headers ( void )

تمام درخواست‌های HTTP را از درخواست فعلی دریافت می‌کند.

This function is only supported when PHP is installed as an Apache module.

Return Values

یک آرایه شرکت‌پذیر از تمام سرایندهای HTTP در درخواست فعلی یا مقدار FALSE در صورت شکست.

Changelog

Version Description
4.3.3

Note:

As of PHP 4.3.3 you can use this function with the NSAPI server module in Netscape/iPlanet/SunONE webservers, too.

4.3.0 پیش از PHP 4.3.0, apache_request_headers() از getallheaders() فراخوانده می‌شد. پس از PHP 4.3.0, getallheaders() یک جایگزین برای apache_request_headers() است.

Examples

Example #1 مثال apache_request_headers()

<?php
$headers 
apache_request_headers();

foreach (
$headers as $header => $value) {
    echo 
"$header$value <br />\n";
}
?>

The above example will output something similar to:

Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0
Host: www.example.com
Connection: Keep-Alive

Notes

Note:

شما همچنین می‌توانید مقدار متغیرهای معمول CGI را از محیط بخوانید البته امکان این امر به استفاده از PHP بر ماجول Apache بستگی دارد. از phpinfo() برای نمایش فهرست تمام متغیرهای محیط موجود استفاده کنید.

Note:

As of PHP 4.3.3 you can use this function with the NSAPI server module in Netscape/iPlanet/SunONE webservers, too.

See Also


Apache Functions
PHP Manual