apache_request_headers

(PHP 4 >= 4.3.0)

apache_request_headers -- Estrae tutti gli header della richiesta HTTP

Descrizione

array apache_request_headers ( void)

apache_request_headers() restituisce un array associativo contenente tutti gli header HTTP nella richiesta corrente. Questa funzionalitą č supportata solo quando PHP č un modulo di Apache.

Nota: Prima del PHP 4.3.0, apache_request_headers() si chiamava getallheaders(). Dopo il PHP 4.3.0, getallheaders() č un alias di apache_request_headers().

Esempio 1. Esempio di apache_request_headers()

<?php
$headers = apache_request_headers();

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

Nota: Č possibile ottenere il valore delle variabili comuni CGI anche leggendole dalle variabili di ambiente; questo funziona indipendentemente dal fatto che si stia usando PHP come modulo Apache. Utilizzare phpinfo() per ottenere una lista di tutte le variabili d'ambiente disponibili.