src/_legacyCode/HttpMessage.php
public function setHeader($name, $value, $replace = true)
    {
        $lowercaseName = strtolower($name);
        if ($replace || !isset($this->headers[$lowercaseName])) {
            $this->headers[$lowercaseName] = array($name, array($value));
        } else {
            $this->headers[$lowercaseName][1][] .= $value;
        }

        $this->messageCache = null;
    }
public function setHeader($name, $value, $replace = true)
    {
        $lowercaseName = strtolower($name);
        if ($replace || !isset($this->headers[$lowercaseName])) {
            $this->headers[$lowercaseName] = array($name, array($value));
        } else {
            $this->headers[$lowercaseName][1][] .= $value;
        }

        $this->messageCache = null;
    }
public function setHeader ( $ name , $ value , $ replace = true ) { $ lowercaseName = strtolower ( $ name ) ; if ( $ replace || ! isset ( $ this -> headers [ $ lowercaseName ] ) ) { $ this -> headers [ $ lowercaseName ] = array ( $ name , array ( $ value ) ) ; } else { $ this -> headers [ $ lowercaseName ] [ 1 ] [ ] .= $ value ; } $ this -> messageCache = null ; }
Adds or replace header with given name with given value.

@param string $name Header name
@param string|array $value Header value. In case of multiple headers with the same name (eg. Set-Cookie) it's
possible to pass an array.
@param bool $replace Indicates if current call should replace header (default) with the same name or just add
another with the same name
Adds or replace header with given name with given value .