略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: curl_multi_strerror

2024-05-02

curl_multi_strerror

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

curl_multi_strerror返回字符串描述的错误代码

说明

curl_multi_strerror(int $errornum): string

返回一个用以描述所给 CURLM 错误代码所对应的错误信息。

参数

errornum

» CURLM 错误代码中的常量之一。

返回值

返回可用错误代码所对应的错误信息,否则返回 null

范例

示例 #1 curl_multi_strerror() 函数的范例:

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

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/function.curl-multi-strerror.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3