Www. php. netmanualhfunction. curl-multi-add-handle.php? Php creates a cURL resource $ ch1curl_init (); $ ch2curl_init (); sets the URL and corresponding options curl_setopt ($ scheme, CURLOPT_URL, www.baidu.com); curl_setopt ($ scheme, CURL
Http://www.php.net/manual/zh/function.curl-multi-add-handle.php? Php // create a pair of cURL resources $ scheme = curl_init (); $ ch2 = curl_init (); // set the URL and the corresponding options curl_setopt ($ scheme, CURLOPT_URL, http://www.baidu.com /); curl_setopt ($ scheme, CURL
Http://www.php.net/manual/zh/function.curl-multi-add-handle.php
// Create a cURL Resource
$ Response = curl_init ();
$ Ch2 = curl_init ();
// Set the URL and corresponding options
Curl_setopt ($ scheme, CURLOPT_URL, "http://www.baidu.com /");
Curl_setopt ($ scheme, CURLOPT_HEADER, 0 );
Curl_setopt ($ ch2, CURLOPT_URL, "http://www.php.net /");
Curl_setopt ($ ch2, CURLOPT_HEADER, 0 );
// Create a cURL handle for Batch Processing
$ Mh = curl_multi_init ();
// Add two handles
Curl_multi_add_handle ($ mh, $ handle );
Curl_multi_add_handle ($ mh, $ ch2 );
$ Running = null;
// Execute the batch processing handle
Do {
Curl_multi_exec ($ mh, $ running );
} While ($ running> 0 );
// Close all handles
Curl_multi_remove_handle ($ mh, $ handle );
Curl_multi_remove_handle ($ mh, $ ch2 );
Curl_multi_close ($ mh );
?>