src/Koldy/Http/Response.php
public function getHeaders(): array
    {
        if ($this->headers === null && $this->headersText !== null) {
            $this->headers = [];

            foreach (explode("\n", $this->headersText) as $line) {
                $pos = strpos($line, ':');

                if ($pos === false) {
                    // this is one-line header
                    $this->headers[$line] = null;
                } else {
                    $name = substr($line, 0, $pos);
                    $value = substr($line, $pos + 1);
                    $this->headers[$name] = trim($value);
                }
            }
        }

        return $this->headers ?? [];
    }
public function getHeaders(): array
    {
        if ($this->headers === null && $this->headersText !== null) {
            $this->headers = [];

            foreach (explode("\n", $this->headersText) as $line) {
                $pos = strpos($line, ':');

                if ($pos === false) {
                    // this is one-line header
                    $this->headers[$line] = null;
                } else {
                    $name = substr($line, 0, $pos);
                    $value = substr($line, $pos + 1);
                    $this->headers[$name] = trim($value);
                }
            }
        }

        return $this->headers ?? [];
    }
public function getHeaders ( ) : array { if ( $ this -> headers === null && $ this -> headersText !== null ) { $ this -> headers = [ ] ; foreach ( explode ( "\n" , $ this -> headersText ) as $ line ) { $ pos = strpos ( $ line , ':' ) ; if ( $ pos === false ) { // this is one-line header $ this -> headers [ $ line ] = null ; } else { $ name = substr ( $ line , 0 , $ pos ) ; $ value = substr ( $ line , $ pos + 1 ) ; $ this -> headers [ $ name ] = trim ( $ value ) ; } } } return $ this -> headers ?? [ ] ; }
Get all response headers as array where key is the header name and value is header value

@return array
Get all response headers as array where key is the header name and value is header value