当前位置:网站首页>Record a debugging when curl has no return value
Record a debugging when curl has no return value
2022-06-25 12:26:00 【sr_ www】
problem :php curl perform post No return value found
debugging : After direct output, it is found that the code is garbled
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
solve : Transcode acquired data
$output = mb_convert_encoding($output, 'UTF-8', 'UTF-8,GBK,GB2312,BIG5');
function post($url, $data = null) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
if ($data) {
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
$output = mb_convert_encoding($output, 'UTF-8', 'UTF-8,GBK,GB2312,BIG5');
curl_close($ch);
return $output ?: '';
}
$url = 'http://xxx.com/ajax/GetJobInfoByBk.ashx';
$data = [
'JobTypeId' => $code,
];
$res = $this->post($url, $data);
dump($res);
边栏推荐
- Explanation of ideas and sharing of pre-processing procedures for 2021 US game D (with pre-processing data code)
- How to use SPSS to do grey correlation analysis? Quick grasp of hand-to-hand Teaching
- Install MySQL client
- 使用php脚本查看已开启的扩展
- Dark horse shopping mall ---6 Brand, specification statistics, condition filtering, paging sorting, highlighting
- 黑马畅购商城---3.商品管理
- Implementing Domain Driven Design - using the ABP framework - Summary of a series of articles
- 20. MVVM command binding of WPF
- What is the primordial universe
- JS monitors the width and height changes of div
猜你喜欢

一套自动化无纸办公系统(OA+审批流)源码:带数据字典

Dark horse shopping mall ---3 Commodity management

架构师为你揭秘在阿里、腾讯、美团工作的区别
![[on]learning dynamic and hierarchical traffic spatiotemporal features with transformer](/img/58/d68112a3d019de66150e2f5102f436.png)
[on]learning dynamic and hierarchical traffic spatiotemporal features with transformer

Découvrir gaussdb (pour redis): une comparaison complète avec Codis

黑马畅购商城---8.微服务网关Gateway和Jwt令牌

20、wpf之MVVM命令绑定

plt. GCA () picture frame and label

Dark horse shopping mall ---8 Microservice gateway and JWT token

Explanation of ideas and sharing of pre-processing procedures for 2021 US game D (with pre-processing data code)
随机推荐
ARM V7 连续加载/存储
Redis雪崩、穿透和击穿是什么?
ARM V7 协处理器
Actual combat summary of Youpin e-commerce 3.0 micro Service Mall project
黑马畅购商城---1.项目介绍-环境搭建
学习笔记 2022 综述 | 自动图机器学习,阐述 AGML 方法、库与方向
黑马畅购商城---6.品牌、规格统计、条件筛选、分页排序、高亮显示
Pycaret successfully resolved the problem that 'sklearn model_ selection._ Search 'import name "\u check\u param\u grid"
为什么ping不通网站 但是却可以访问该网站?
sudo: ulimit: command not found
SDN系统方法 | 9. 接入网
Upgrade opsenssh to 8.8p1
如果你也想做自媒体,不妨听大周给您点建议
What are redis avalanche, penetration and breakdown?
Update of complex JSON in MySQL
Is it safe to open an account and buy stocks on the Internet?
Use PHP script to view the opened extensions
Execution order of MySQL query statements join, on and where
Hook技术
2022 meisai topic C idea sharing + translation