public function toString(array $opts = array())
    {
        $eol = empty($opts['canonical'])
            ? $this->_eol
            : "\r\n";
        $text = '';

        foreach ($this->toArray($opts) as $key => $val) {
            foreach ((is_array($val) ? $val : array($val)) as $entry) {
                $text .= $key . ': ' . $entry . $eol;
            }
        }

        return $text . $eol;
    }
public function toString(array $opts = array())
    {
        $eol = empty($opts['canonical'])
            ? $this->_eol
            : "\r\n";
        $text = '';

        foreach ($this->toArray($opts) as $key => $val) {
            foreach ((is_array($val) ? $val : array($val)) as $entry) {
                $text .= $key . ': ' . $entry . $eol;
            }
        }

        return $text . $eol;
    }
public function toString ( array $ opts = array ( ) ) { $ eol = empty ( $ opts [ 'canonical' ] ) ? $ this -> _eol : "\r\n" ; $ text = '' ; foreach ( $ this -> toArray ( $ opts ) as $ key => $ val ) { foreach ( ( is_array ( $ val ) ? $ val : array ( $ val ) ) as $ entry ) { $ text .= $ key . ': ' . $ entry . $ eol ; } } return $ text . $ eol ; }
Returns all headers concatenated into a single string.

@param array $opts  See toArray().

@return string  The headers in string format.
Returns all headers concatenated into a single string .