- 授权协议: MIT
- 开发语言: PHP
- 操作系统: 跨平台
- 软件首页: https://gitee.com/hhxsv5/php-multi-curl
- 软件文档: https://gitee.com/hhxsv5/php-multi-curl/blob/master/README.md
软件介绍
php-multi-curl 是一个简单而有效的库,封装了 curl_multi_*,用于处理并行的 http 请求。
要求
PHP 5.4 or later
PHP cURL extension
用法
//require '../vendor/autoload.php';
use Hhxsv5\PhpMultiCurl\Curl;
use Hhxsv5\PhpMultiCurl\MultiCurl;
//Single http request
$options = [//The custom options of cURL
CURLOPT_TIMEOUT => 10,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_USERAGENT => 'Multi-cURL client v1.5.0',
];
$c = new Curl($options);
$c->makeGet($getUrl);
$response = $c->exec();
if ($response->hasError()) {
//Fail
var_dump($response->getError());
} else {
//Success
var_dump($response->getBody());
}
//Reuse $c
$c->makePost($postUrl);
$response = $c->exec();
if ($response->hasError()) {
//Fail
var_dump($response->getError());
} else {
//Success
var_dump($response->getBody());
}
PHP实战
Dagfinn Reiersol、Marcus Baker、Chris Shiflett / 张颖 等、段大为 审校 / 人民邮电出版社 / 2010-01 / 69.00元
“对于那些想要在PHP方面更进一步的开发者而言,此书必不可少。” ——Gabriel Malkas, Developpez.com “简而言之,这是我所读过的关于面向对象编程和PHP最好的图书。……强烈推荐此书,绝不要错过!” ——Amazon评论 “此书是理论与实践的完美融合,到目前为止,其他任何图书都无法与它相媲美。如果5颗星是满分,它完全值得10颗星!” ——A......一起来看看 《PHP实战》 这本书的介绍吧!
