protected function _headersToString($headers, $eol = "\r\n")
    {
        $out = '';
        foreach ($headers as $key => $value) {
            if ($value === false || $value === null || $value === '') {
                continue;
            }
            $out .= $key . ': ' . $value . $eol;
        }
        if (!empty($out)) {
            $out = substr($out, 0, -1 * strlen($eol));
        }

        return $out;
    }
protected function _headersToString($headers, $eol = "\r\n")
    {
        $out = '';
        foreach ($headers as $key => $value) {
            if ($value === false || $value === null || $value === '') {
                continue;
            }
            $out .= $key . ': ' . $value . $eol;
        }
        if (!empty($out)) {
            $out = substr($out, 0, -1 * strlen($eol));
        }

        return $out;
    }
protected function _headersToString ( $ headers , $ eol = "\r\n" ) { $ out = '' ; foreach ( $ headers as $ key => $ value ) { if ( $ value === false || $ value === null || $ value === '' ) { continue ; } $ out .= $ key . ': ' . $ value . $ eol ; } if ( ! empty ( $ out ) ) { $ out = substr ( $ out , 0 , - 1 * strlen ( $ eol ) ) ; } return $ out ; }
Help to convert headers in string

@param array $headers Headers in format key => value
@param string $eol End of line string.
@return string
Help to convert headers in string