Easy Tutorial
❮ Php Print_R Function Php Image Gd ❯

PHP curl_multi_strerror Function

PHP cURL Reference Manual

(PHP 5 >= 5.5.0)

curl_multi_strerror — Returns a string describing the error code.


Description

string curl_multi_strerror ( int $errornum )

Returns a string describing the CURLM error code.


Parameters

errornum

One of the constants from CURLM error codes.


Return Value

Returns a string describing the error code, or NULL otherwise.


Example

<?php
// Create cURL handles
$ch1 = curl_init("https://www.tutorialpro.org/");
$ch2 = curl_init("http://php.net/");

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

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

PHP cURL Reference Manual

❮ Php Print_R Function Php Image Gd ❯