[PHP-NOTES] note 130270 added to function.getallheaders

[email protected] ("[email protected]")
Newsgroups php.notes
Message-ID <[email protected]>
if you want a specific header,
<?php
function get_response_header(string $header_name = 'Content-Type', bool $trim = true): ?string
{
    $header_name .= ':';
    $list = headers_list();
    $len = strlen($header_name);
    foreach ($list as $header) {
        if (strncasecmp($header, $header_name, $len) === 0) {
            $ret = substr($header, $len);
            if ($trim) {
                $ret = trim($ret);
            }
            return $ret;
        }
    }
    return null;
}
?>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 62.101.231.203)
----
Manual Page -- https://php.net/manual/en/function.getallheaders.php
Edit        -- https://main.php.net/note/edit/130270
Del: integrated  -- https://main.php.net/note/delete/130270/integrated
Del: useless     -- https://main.php.net/note/delete/130270/useless
Del: bad code    -- https://main.php.net/note/delete/130270/bad+code
Del: spam        -- https://main.php.net/note/delete/130270/spam
Del: non-english -- https://main.php.net/note/delete/130270/non-english
Del: in docs     -- https://main.php.net/note/delete/130270/in+docs
Del: other reasons-- https://main.php.net/note/delete/130270
Reject      -- https://main.php.net/note/reject/130270
Search      -- https://main.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.