首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

curl_multi_strerror

(PHP 5 >= 5.5.0, PHP 7)

curl_multi_strerror - 返回描述错误代码的字符串

描述

代码语言:javascript
复制
string curl_multi_strerror ( int $errornum )

返回描述给定CURLM错误代码的文本错误消息。

参数

errornum

其中一个»CURLM错误代码常量。

返回值

返回有效错误代码的错误字符串,否则返回NULL

例子

Example #1 curl_multi_strerror() example

代码语言:javascript
复制
<?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_multi_setopt

curl_pause →

扫码关注腾讯云开发者

领取腾讯云代金券