-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp_bak.php
More file actions
32 lines (22 loc) · 719 Bytes
/
http_bak.php
File metadata and controls
32 lines (22 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
$urls = array(
"http://qq.com/",
"http://www.hao123.com/?1536217914",
);
$mh = curl_multi_init();
foreach ($urls as $i => $url) {
$conn[$i] = curl_init($url);
curl_setopt($conn[$i], CURLOPT_RETURNTRANSFER, 1);
curl_multi_add_handle($mh, $conn[$i]);
}
do {
$status = curl_multi_exec($mh, $active);
$info = curl_multi_info_read($mh);
if (false !== $info) var_dump($info);
} while ($status === CURLM_CALL_MULTI_PERFORM || $active);
$stop=1;
foreach ($urls as $i => $url) $res[$i] = curl_multi_getcontent($conn[$i]);
//curl_close($conn[$i]);
//$data=curl_multi_info_read($mh);
foreach ($urls as $i => $url) $res[$i] = curl_multi_getcontent($conn[$i]);
curl_multi_close($mh);