Web студия "GrandView"
  Главная   Написать Контакты
   
   
О проекте
Руководство php
 

getallheaders

(PHP 3, PHP 4, PHP 5)

getallheaders -- Получить все заголовки HTTP-запроса

Описание

array getallheaders ( void )

Получить все заголовки для данного HTTP-запроса.

Эта функция является псевдонимом функции apache_request_headers(). Пожалуйста, обратитесь к описанию функции apache_request_headers() для получения детальной информации о данной функции.

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

Возвращаемые значения

Ассоциативный массив, содержащий все HTTP-заголовки для данного запроса или FALSE при неудаче.

Список изменений

ВерсияОписание
4.3.0 Функция стала псефдонимом для apache_request_headers(). Соответствующим образом, она была переименована. Это связано с тем, что эта функция работоспособна только в том случае, если PHP был собран в качестве модуля Apache.

Примечания

Замечание: Начиная с PHP 4.3.3 вы также можете использовать эти функции с модулем NSAPI в серверах Netscape/iPlanet/SunONE.

Смотрите также

apache_response_headers()



virtual> <ebcdic2ascii
Last updated: Fri, 26 Jan 2007
 
add a note add a note User Contributed Notes
getallheaders
tigr at mail15 dot com
19-May-2006 04:08
And even better one, that absolutely mimics getallheaders behaviour (including keynames - first character in each word is uppercase and words separated with '-' instead of underscore), and still does not use regexp:
<?php
function emu_getallheaders() {
   foreach(
$_SERVER as $name => $value)
       if(
substr($name, 0, 5) == 'HTTP_')
          
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
   return
$headers;
}
?>
tigr at mail15 dot com
19-May-2006 03:44
Just a bit faster version of ZevS' function (does not use regular expressions and does not require POSIX regexps that is in PECL in php6):
<?php
function emu_getallheaders() {
   foreach(
$_SERVER as $name => $value)
       if(
substr($name, 0, 5) == 'HTTP_')
          
$headers[substr($name, 5)] = $value;
   return
$headers;
}
?>
lorro at lorro dot hu
19-Apr-2005 06:25
Beware that RFC2616 (HTTP/1.1) defines header fields as case-insensitive entities. Therefore, array keys of getallheaders() should be converted first to lower- or uppercase and processed such.
ZevS
17-Apr-2005 01:24
if PHP installed not as Apache-module:

<?php
function emu_getallheaders() {
    foreach(
$_SERVER as $h=>$v)
        if(
ereg('HTTP_(.+)',$h,$hp))
           
$headers[$hp[1]]=$v;
    return
$headers;
}
?>

I put this code to file "/var/www/include", and edit php.ini:
auto_prepend_file = "/var/www/include"
jukkaho at mail dot student dot oulu dot fi
17-Jan-2003 02:14
This function really is useful. Although $_SERVER['HTTP_*']-variables seem to include all request headers, they are really only the most generally needed - not all of them.

One example that needs this functionality is Digest Authentication (http://www.ietf.org/rfc/rfc2617.txt). When implementing it in PHP script, you can't read client's "Authorization"-header without this function.
jarl at diku dot dk
25-Mar-2000 03:15
All the environment variables can be found here:
http://www.php.net/manual/language.variables.predefined.php

virtual> <ebcdic2ascii
Last updated: Fri, 26 Jan 2007
 
 
Новости
11 июля 2007
Сайт запущен
© 2007 info@grandviewstudio.com

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/sites/grandviewstudiocom/www/65f67d67a94ad980786580ae69e11c07/sape.php on line 324

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/sites/grandviewstudiocom/www/65f67d67a94ad980786580ae69e11c07/sape.php on line 330
Z058440144362 Z348613067571