标签:tps cti host https turn close 输出 exe fun
public function request($curl,$https=true,$method=‘‘,$data=null){
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, $curl);//设置URL
curl_setopt($ch, CURLOPT_HEADER, false);//设置头信息
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);//只获取页面内容 不输出
if($https){
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);//不做服务器认证
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);//不做客户端认证
}
if($method==‘post‘){
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
$str=curl_exec($ch);
curl_close($ch);
return $str;
}
标签:tps cti host https turn close 输出 exe fun
原文地址:https://www.cnblogs.com/chentailin/p/9139066.html