public function httpcurls($url,$data,$is_post=0,$header=null)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);//初始化curl会话
if (!empty($header)){
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);//自动设置访问header信息
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//将获取的信息以字符串返回
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);//禁止进行证书验证 https
if ($is_post == 1){
curl_setopt($ch, CURLOPT_POST, 1);//curl post 访问
}
if (!empty($data)){
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);//post传递的参数值
}
$output = curl_exec($ch);
curl_close($ch);//关闭curl资源 并且释放
return $output;
}