note 77630 added to function.curl-multi-exec
| From: | shichuanr at gmail dot com | Date: | Thu, 06 Sep 2007 12:12:13 +0000 |
| Subject: | note 77630 added to function.curl-multi-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130240@lists.php.net to get a copy of this message | ||
For people who have problem running the above example script(Example 425. curl_multi_exec()), you
can alter it a little bit to make it work properly by replacing the existing chunk of code with the
one below:
<?php
// create both cURL resources
$ch1 = curl_init();
$ch2 = curl_init();
// set URL and other appropriate options
curl_setopt($ch1, CURLOPT_URL, "http://www.google.com/");
curl_setopt($ch1, CURLOPT_HEADER, 0);
curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/");
curl_setopt($ch2, CURLOPT_HEADER, 0);
//create the multiple cURL handle
$mh = curl_multi_init();
//add the two handles
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);
$running=null;
//execute the handles
do {
curl_multi_exec($mh,$running);
} while ($running > 0);
//close the handles
curl_multi_remove_handle($mh,$ch1);
curl_multi_remove_handle($mh,$ch1);
curl_multi_close($mh);
?>
----
Server IP: 203.220.0.234
Probable Submitter: 202.147.54.115
----
Manual Page -- http://www.php.net/manual/en/function.curl-multi-exec.php
Edit -- https://master.php.net/note/edit/77630
Del: integrated -- https://master.php.net/note/delete/77630/integrated
Del: useless -- https://master.php.net/note/delete/77630/useless
Del: bad code -- https://master.php.net/note/delete/77630/bad+code
Del: spam -- https://master.php.net/note/delete/77630/spam
Del: non-english -- https://master.php.net/note/delete/77630/non-english
Del: in docs -- https://master.php.net/note/delete/77630/in+docs
Del: other reasons-- https://master.php.net/note/delete/77630
Reject -- https://master.php.net/note/reject/77630
Search -- https://master.php.net/manage/user-notes.php