php curl 多线程抓取数据能判断分别来自哪个url吗?
$mh = curl_multi_init(); // 开启多线程<br /> <br /> $i = 0;<br /> foreach($url_array as $url) {<br /> $ch = curl_init();<br /> if (IS_PROXY) {<br /> curl_setopt ($ch, CURLOPT_PROXY,'67.215.228.129:8089' );//60.12.226.18<br /> } <br /> curl_setopt($ch, CURLOPT_URL, $url);<br /> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return don't print<br /> curl_setopt($ch, CURLOPT_TIMEOUT, 30); //设置超时时间<br /> curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');<br /> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // 302 redirect<br /> curl_setopt($ch, CURLOPT_MAXREDIRS, 7); //HTTp定向级别<br /> curl_multi_add_handle($mh, $ch); // 把 curl resource 放进 multi curl handler 里<br /> $handle[$i++] = $ch;<br /> }