protected function prepareCurlOptions ( $curl_options, $extra_headers )
	{
		$hs = array();
		if (!empty($curl_options[CURLOPT_HTTPHEADER]) && is_array($curl_options[CURLOPT_HTTPHEADER]))
		{
			foreach ($curl_options[CURLOPT_HTTPHEADER] as $h)
			{
				list($opt, $val) = explode(':', $h, 2);
				$opt      = str_replace(' ', '-', ucwords(str_replace('-', ' ', $opt)));
				$hs[$opt] = $val;
			}
		}

		$curl_options[CURLOPT_HTTPHEADER] = array();
		$hs = array_merge($hs, $extra_headers);
		foreach ($hs as $h => $v)
		{
			$curl_options[CURLOPT_HTTPHEADER][] = "$h: $v";
		}
		return $curl_options;
	}
protected function prepareCurlOptions ( $curl_options, $extra_headers )
	{
		$hs = array();
		if (!empty($curl_options[CURLOPT_HTTPHEADER]) && is_array($curl_options[CURLOPT_HTTPHEADER]))
		{
			foreach ($curl_options[CURLOPT_HTTPHEADER] as $h)
			{
				list($opt, $val) = explode(':', $h, 2);
				$opt      = str_replace(' ', '-', ucwords(str_replace('-', ' ', $opt)));
				$hs[$opt] = $val;
			}
		}

		$curl_options[CURLOPT_HTTPHEADER] = array();
		$hs = array_merge($hs, $extra_headers);
		foreach ($hs as $h => $v)
		{
			$curl_options[CURLOPT_HTTPHEADER][] = "$h: $v";
		}
		return $curl_options;
	}
protected function prepareCurlOptions ( $ curl_options , $ extra_headers ) { $ hs = array ( ) ; if ( ! empty ( $ curl_options [ CURLOPT_HTTPHEADER ] ) && is_array ( $ curl_options [ CURLOPT_HTTPHEADER ] ) ) { foreach ( $ curl_options [ CURLOPT_HTTPHEADER ] as $ h ) { list ( $ opt , $ val ) = explode ( ':' , $ h , 2 ) ; $ opt = str_replace ( ' ' , '-' , ucwords ( str_replace ( '-' , ' ' , $ opt ) ) ) ; $ hs [ $ opt ] = $ val ; } } $ curl_options [ CURLOPT_HTTPHEADER ] = array ( ) ; $ hs = array_merge ( $ hs , $ extra_headers ) ; foreach ( $ hs as $ h => $ v ) { $ curl_options [ CURLOPT_HTTPHEADER ] [ ] = "$h: $v" ; } return $ curl_options ; }
Mix the given headers into the headers that were given to curl

@param array curl_options
@param array extra_headers
@return array new curl options
Mix the given headers into the headers that were given to curl