1
$ch = curl_init();
$ch1 = curl_init();

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

Can i change options of $chor $ch1for example like this :

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);

Does it change the values of $ch1 and $ch inside the curl multi handler also? So basically I am asking if I can change the options of curl handles even after I added them to a multi handler?

1 Answer 1

1

Yes you may change any options of each curl child.

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);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.