导航首页 » 技术教程 » PHP:curl_multi_strerror()的用法_cURL函数
PHP:curl_multi_strerror()的用法_cURL函数 133 2023-12-17   

curl_multi_strerror

(PHP 5 >= 5.5.0)

curl_multi_strerror — Return string describing error code

说明

string curl_multi_strerror ( int $errornum )

Returns a text error message describing the given CURLM error code.

参数

errornum

One of the » CURLM error codes constants.

返回值

Returns error string for valid error code, NULL otherwise.

范例

Example #1 curl_multi_strerror() example

<?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);
?>

参见

curl_strerror() - Return string describing the given error code » cURL error codes



!!!站长长期在线接!!!

网站、小程序:定制开发/二次开发/仿制开发等

各种疑难杂症解决/定制接口/定制采集等

站长微信:lxwl520520

站长QQ:1737366103