PHP curl_multi_strerror函数
PHP curl_multi_strerror函数
(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.runoob.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 EOF(heredoc) 使用说明
- PHP 运算符
- PHP 文件处理
- PHP Cookie
- PHP 异常处理
- PHP array_filter() 函数
- PHP array_key_exists() 函数
- PHP array_map() 函数
- PHP array_search() 函数
- PHP array_shift() 函数
- PHP current() 函数
- PHP key() 函数
- PHP krsort() 函数
- PHP shuffle() 函数
- PHP uksort() 函数
- PHP 5 Calendar 函数
- PHP Error 和 Logging 函数
- PHP 5 Filesystem 函数
- PHP HTTP 函数
- PHP Mail 函数