curl_multi_strerror

curl_multi_strerror

(PHP 5 >= 5.5.0, PHP 7)

curl_multi_strerrorReturn string describing error code

Description

string curl_multi_strerror ( int $errornum )

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

Parameters

errornum

One of the » CURLM error codes constants.

Return Values

Returns error string for valid error code, NULL otherwise.

Examples

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

See Also

© 1997–2017 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://secure.php.net/manual/en/function.curl-multi-strerror.php

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部