curl_multi_strerror

Return string describing error code

&reftitle.description; ``string``null```curl_multi_strerror` `int` `error_code`

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

&reftitle.parameters;

`error_code`

- One of the CURLM error codes constants.

&reftitle.returnvalues;

Returns error string for valid error code, &null; otherwise.

&reftitle.examples;

### `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);
        if ($active) {
            curl_multi_select($mh);
        }
    } while ($active && $status === CURLM_OK);

    // Check for errors
    if ($status != CURLM_OK) {
        // Display error message
        echo "ERROR!\n " . curl_multi_strerror($status);
    }

    ?>

&reftitle.seealso;

- `curl_strerror`
- cURL error codes