PHP curl_multi_strerror函数

PHP 教程 · 2019-01-23 15:12:20

(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 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Computational Advertising

Computational Advertising

by Kushal Dave、Vasudeva Varma / Now Publishers Inc / 2014

Computational Advertising (CA), popularly known as online advertising or Web advertising, refers to finding the most relevant ads matching a particular context on the Web. The context depends on the t......一起来看看 《Computational Advertising》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器