<?php
// Create cURL handles
$ch1 = curl_init("http://example.com"/);
$ch2 = curl_init("http://php.net/");

// Create a cURL multi handle
$mh = curl_multi_init();

// Add the handles to the multi handle
curl_multi_add_handle($mh, $ch1);
curl_multi_add_handle($mh, $ch2);

// Execute the multi handle
do {
$status = curl_multi_exec($mh, $active);
// Check for errors
if($status > 0) {
// Display error message
echo "ERROR!\n " . curl_multi_strerror($status);
}
} while ($status === CURLM_CALL_MULTI_PERFORM || $active);
?>

文章標籤
全站熱搜
創作者介紹
創作者 stockwfj3 的頭像
stockwfj3

程式設計@筆記

stockwfj3 發表在 痞客邦 留言(0) 人氣(3)