public function setHeader($name, $values = null, $replace = true)
    {
        if (is_array($name)) {
            foreach ($name as $key => $value) {
                $this->setHeader($key, $value);
            }
            return $this;
        }

        $values = (array)$values;
        if (true === $replace || !isset($this->headers[$name])) {
            $this->headers[$name] = $values;
        } else {
            $this->headers[$name] = array_merge($this->headers[$name], $values);
        }

        return $this;
    }
public function setHeader($name, $values = null, $replace = true)
    {
        if (is_array($name)) {
            foreach ($name as $key => $value) {
                $this->setHeader($key, $value);
            }
            return $this;
        }

        $values = (array)$values;
        if (true === $replace || !isset($this->headers[$name])) {
            $this->headers[$name] = $values;
        } else {
            $this->headers[$name] = array_merge($this->headers[$name], $values);
        }

        return $this;
    }
public function setHeader ( $ name , $ values = null , $ replace = true ) { if ( is_array ( $ name ) ) { foreach ( $ name as $ key => $ value ) { $ this -> setHeader ( $ key , $ value ) ; } return $ this ; } $ values = ( array ) $ values ; if ( true === $ replace || ! isset ( $ this -> headers [ $ name ] ) ) { $ this -> headers [ $ name ] = $ values ; } else { $ this -> headers [ $ name ] = array_merge ( $ this -> headers [ $ name ] , $ values ) ; } return $ this ; }
Set the header string

@param  string|array $name The header name or header array
@param  string|array $values The header values
@param  bool $replace Whether replace the exists values or not
@return $this
Set the header string