话不多说,直接上代码
$url = "https://www.xxx.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); //请求url地址
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //设置获取页面内容
curl_setopt($ch, CURLOPT_HEADER, 0); //不设置头部
curl_setopt($ch, CURLOPT_PROXY, '183.111.xxx.xxx'); //代理服务器地址
curl_setopt($ch, CURLOPT_PROXYPORT, '9999'); //代理服务器端口
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); //不验证证书
//curl_setopt($ch, CURLOPT_POSTFIELDS, $urlpost);//提交参数
curl_setopt($ch, CURLOPT_POST, 1); //post提交
$output = curl_exec($ch); //请求返回值
$errorinfo = curl_error($ch); //请求返回错误信息
curl_close($ch);