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