src/curlient/Curlient.php
protected function parseHeaders($curl, $header) {
		$len    = strlen($header);
		$header = explode(':', $header, 2);

		if (count($header) < 2) { // ignore invalid headers
			return $len;
		}
		$name = trim($header[0]);
		if ($name == 'Set-Cookie') {
			$this->parseCookie(trim($header[1]));
		} else if ($name == 'Content-Type' && preg_match('#(.+;\s+)?charset=(.+)$#', $header[1], $charset)) {
			$this->encoding = trim(strtoupper(isset($charset[2]) ? $charset[2] : $charset[1]));
		}

		return $len;
	}
protected function parseHeaders($curl, $header) {
		$len    = strlen($header);
		$header = explode(':', $header, 2);

		if (count($header) < 2) { // ignore invalid headers
			return $len;
		}
		$name = trim($header[0]);
		if ($name == 'Set-Cookie') {
			$this->parseCookie(trim($header[1]));
		} else if ($name == 'Content-Type' && preg_match('#(.+;\s+)?charset=(.+)$#', $header[1], $charset)) {
			$this->encoding = trim(strtoupper(isset($charset[2]) ? $charset[2] : $charset[1]));
		}

		return $len;
	}
解析响应头.

@param resource $curl
@param string   $header 响应头数据.

@return int