Home  >  Article  >  Backend Development  >  PHP curl_multi_exec函数的定义及用法详解

PHP curl_multi_exec函数的定义及用法详解

巴扎黑
巴扎黑Original
2017-05-25 17:41:272164browse

本文讲解PHP curl_multi_exec函数的定义及用法实例,那curl_multi_exec函数的作用含义是 运行当前 cURL 句柄的子连接,下面具体来看它的说明与使用实例。

curl_multi_exec函数说明

int curl_multi_exec ( resource $mh , int &$still_running )

处理在栈中的每一个句柄。无论该句柄需要读取或写入数据都可调用此方法。

curl_multi_exec函数参数

mh

由 curl_multi_init() 返回的 cURL 多个句柄。

still_running

一个用来判断操作是否仍在执行的标识的引用。

curl_multi_exec函数返回值

一个定义于 cURL 预定义常量中的 cURL 代码。

注意: 该函数仅返回关于整个批处理栈相关的错误。即使返回 CURLM_OK 时单个传输仍可能有问题。

curl_multi_exec函数实例

这个范例将会创建 2 个 cURL 句柄,把它们加到批处理句柄,然后并行地运行它们。

The above is the detailed content of PHP curl_multi_exec函数的定义及用法详解. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]