Zend\Diactoros\MessageTrait::getHeaders PHP Method

getHeaders() public method

The keys represent the header name as it will be sent over the wire, and each value is an array of strings associated with the header. Represent the headers as a string foreach ($message->getHeaders() as $name => $values) { echo $name . ": " . implode(", ", $values); } Emit headers iteratively: foreach ($message->getHeaders() as $name => $values) { foreach ($values as $value) { header(sprintf('%s: %s', $name, $value), false); } }
public getHeaders ( ) : array
return array Returns an associative array of the message's headers. Each key MUST be a header name, and each value MUST be an array of strings.
    public function getHeaders()
    {
        return $this->headers;
    }