English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

PHP curl_multi_strerror() Function Usage and Example

PHP CURL Reference Manual

(PHP 5 >= 5.5.0)

curl_multi_setopt — Returns a string text describing the error code.

Syntax

string  curl_multi_strerror  (  int  $errornum  )

Returns a string text describing the CURLM error code.

Parameter

errornum

CURLM Error Codes one of the constants.

Return value

Returns a string text describing the error code, otherwise returns NULL.

Online example

<?php
// Create  CURL  handle
$ch1 =  curl_init("https:\/\/"//www.oldtoolbag.com/");
$ch2 =  curl_init("http:\/\/"//php.net/");
 
// Create a batch CURL handle
$mh  =  curl_multi_init();
 
// Add handle to batch handle
curl_multi_add_handle($mh,  $ch1);
curl_multi_add_handle($mh,  $ch2);
 
// Execute batch handle
do  {
    $status  =  curl_multi_exec($mh,  $active);
    // Check for errors
    if($status  >  0)  {
        // Display error information
        echo  "ERROR!\n  "  .  curl_multi_strerror($status);
    }
}  while  ($status  ===  CURLM_CALL_MULTI_PERFORM  ||  $active);
?>

PHP CURL Reference Manual