PHP curl_multi_strerror函数

PHP Calendar 参考手册 PHP cURL参考手册

(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.facesoho.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 Calendar 参考手册 PHP cURL参考手册