curl_multi_strerror
(PHP 5 >= 5.5.0, PHP 7, PHP 8)
curl_multi_strerror — 返回字符串描述的错误代码
说明
curl_multi_strerror(int
$errornum
): string返回一个用以描述所给 CURLM 错误代码所对应的错误信息。
参数
-
errornum
-
» CURLM 错误代码中的常量之一。
返回值
返回可用错误代码所对应的错误信息,否则返回 null
。
范例
示例 #1 curl_multi_strerror() 函数的范例:
<?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);
?>

User Contributed Notes
There are no user contributed notes for this page.
备份地址:http://www.lvesu.com/blog/php/function.curl-multi-strerror.php