2011-05-15 73 views
1
$ch = curl_init(); 
$ch1 = curl_init(); 

$mh = curl_multi_init();  
curl_multi_add_handle($mh,$ch); 
curl_multi_add_handle($mh,$ch2); 

我可以改变的$ch$ch1选项,例如像这样:PHP卷曲多处理

curl_setopt($ch1, CURLOPT_REFERER, $ref); 
curl_setopt($ch1, CURLOPT_USERAGENT, $useragent); 

$data = array('cmd' => 'login', 'username' => 'test', 'password' => 'test'); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 

它是否在改变卷曲多处理器也在里面的$ CH1和$ CH值是多少? 所以基本上我问我是否可以改变卷曲手柄的选项,即使我将它们添加到多处理器后?

回答

1

是的,您可以更改每个卷发儿童的任何选项。

curl_setopt($ch1, CURLOPT_URL, "http://www.example.com/"); 
curl_setopt($ch1, CURLOPT_HEADER, 0); 
curl_setopt($ch, CURLOPT_URL, "http://www.example2.net/"); 
curl_setopt($ch, CURLOPT_HEADER, 0); 
+0

你确定?我刚刚测试过,但我没有做到这一点。 – Jaanus 2011-05-15 19:53:16