📜  pht 从请求中获取标头 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:07.926000             🧑  作者: Mango

代码示例1
 $value) {
        if (substr($key, 0, 5) <> 'HTTP_') {
            continue;
        }
        $header = str_replace(' ', '-', ucwords(str_replace('_', ' ', strtolower(substr($key, 5)))));
        $headers[$header] = $value;
    }
    return $headers;
}

$headers = getRequestHeaders();

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