protected function encodeHeaders($headers = [])
    {
        $data = '';

        foreach ($headers as $name=>$values)
        {
            $temp = [];
            $data .= $name . ": ";
            $values = (array) $values;

            foreach ($values as $value)
            {
                $temp[] = $this->encodeHeader($value);
            }

            $data .= implode(", ", $temp);
            $data .= "\r\n";
        }

        return $data;
    }
protected function encodeHeaders($headers = [])
    {
        $data = '';

        foreach ($headers as $name=>$values)
        {
            $temp = [];
            $data .= $name . ": ";
            $values = (array) $values;

            foreach ($values as $value)
            {
                $temp[] = $this->encodeHeader($value);
            }

            $data .= implode(", ", $temp);
            $data .= "\r\n";
        }

        return $data;
    }
protected function encodeHeaders ( $ headers = [ ] ) { $ data = '' ; foreach ( $ headers as $ name => $ values ) { $ temp = [ ] ; $ data .= $ name . ": " ; $ values = ( array ) $ values ; foreach ( $ values as $ value ) { $ temp [ ] = $ this -> encodeHeader ( $ value ) ; } $ data .= implode ( ", " , $ temp ) ; $ data .= "\r\n" ; } return $ data ; }
Encode headers.

@param string[][] $headers
@return string
Encode headers .