Home Menu

curl_strerror

Return string describing the given error code

Syntax

curl_strerror ( int $errornum ) : string

Parameters

errornum

One of the cURL error codes constants.

Return

Returns error description or NULL for invalid error code.

Examples

<?

$ch = curl_init();

    // create a misspelled protocol in the URL
    curl_setopt($ch, CURLOPT_URL, "htps://osbo.com/");

    curl_exec($ch);
    
    if ($errornum = curl_errno($ch)) {
        $return = curl_strerror($errornum);

        echo "cURL error $errornum: $return";
    }

curl_close($ch);

?>
cURL error 1: Unsupported protocol

PHP

JesusBible
HTMLCSSJSPHPSVGMore
AboutTerms