2011-05-15 74 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