2 Star 0 Fork 1

kuaidaili/php-sdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
stream_demo.php 663 Bytes
一键复制 编辑 原始数据 按行查看 历史
Kuaidaili-Dev 提交于 3年前 . 更新链接
<?php
// gzip解压缩函数
if (!function_exists('gzdecode')) {
function gzdecode($data) {
// strip header and footer and inflate
return gzinflate(substr($data, 10, -8));
}
}
//api链接
$api_url = "http://dev.kdlapi.com/api/getproxy/?secret_id=o1fjh1re9o28876h7c08&signature=xxxxx&num=100&protocol=1&method=2&an_ha=1&sep=1";
$opts = array('http' =>
array(
'method' => 'GET',
'header' => 'Accept-Encoding: gzip', // 使用gzip压缩让数据传输更快
)
);
$context = stream_context_create($opts);
$result = file_get_contents($api_url, false, $context);
echo gzdecode($result); // 输出返回内容
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kuaidaili/php-sdk.git
git@gitee.com:kuaidaili/php-sdk.git
kuaidaili
php-sdk
php-sdk
master

搜索帮助