PHP 教程 PHP curl_multi_strerror函数

lennon · 2022-03-07 00:04:08 · 热度: 12

(PHP 5 >= 5.5.0)

curl_multi_setopt — 返回描述错误码的字符串文本。

说明

string curl_multi_strerror ( int $errornum )

返回描述 CURLM 错误码的字符串文本。

参数

errornum

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

返回值

返回描述错误码的字符串文本, 否则返回 NULL。

实例

实例

<?php // 创建 cURL 句柄 $ch1 = curl_init("https://www.codercto.com/"); $ch2 = curl_init("http://php.net/"); // 创建一个批处理cURL句柄 $mh = curl_multi_init(); // 添加句柄到批处理句柄 curl_multi_add_handle($mh, $ch1); curl_multi_add_handle($mh, $ch2); // 执行批处理句柄 do { $status = curl_multi_exec($mh, $active); // 检查错误 if($status > 0) { // 显示错误信息 echo "ERROR!\n " . curl_multi_strerror($status); } } while ($status === CURLM_CALL_MULTI_PERFORM || $active); ?>

查看更多 PHP cURL 函数

猜你喜欢:
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册