PHP: curl_multi_exec - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

curl_multi_getcontent curl_multi_close

Last updated: Fri, 26 Jan 2007

view this page in

# curl_multi_exec

(PHP 5)

curl_multi_exec -- Выполняет операции с набором cURL дескрипторов

## Описание

int curl_multi_exec ( resource mh )

Внимание
К настоящему времени эта функция еще не была документирована; для ознакомления доступен только список аргументов.

См. также описание функций curl_multi_init() и curl_exec().

add a note User Contributed Notes
curl_multi_exec
dtorop933 at gmail dot com
07-Jan-2005 10:21
`<?php
$connomains = array(
"http://www.cnn.com/",
"http://www.canada.com/",
"http://www.yahoo.com/"
);
$mh = curl_multi_init();
foreach ($connomains as $i => $url) {
$conn[$i] = curl_init($url);
curl_setopt($conn[$i], CURLOPT_RETURNTRANSFER, 1);
curl_multi_add_handle ($mh,$conn[$i]);
}
// start performing the request
do {
$mrc = curl_multi_exec($mh, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM);
while ($active and $mrc == CURLM_OK) {
// wait for network
if (curl_multi_select($mh) != -1) {
// pull in any new data, or at least handle timeouts
do {
$mrc = curl_multi_exec($mh, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM);
}
}
if ($mrc != CURLM_OK) {
print "Curl multi read error $mrc\n";
}
// retrieve data
foreach ($connomains as $i => $url) {
if (($err = curl_error($conn[$i])) == '') {
$res[$i]=curl_multi_getcontent($conn[$i]);
} else {
print "Curl error on handle $i: $err\n";
}
curl_multi_remove_handle($mh,$conn[$i]);
curl_close($conn[$i]);
}
curl_multi_close($mh);
print_r($res);
?>`
add a note
curl_multi_getcontent curl_multi_close

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST