<?php

function curl_get_https($url)

{
$curl = curl_init();

//如果需要参数,设置POST参数

$post_string = array('usercode'=>'123456','password'=>'123'); 
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post_string));


curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // 跳过检查
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); // 跳过检查
$tmpInfo = curl_exec($curl);
curl_close($curl);
return $tmpInfo; //返回json对象
}

$url = "https://www.baidu.com";
$result = curl_get_https($url);
var_dump($result);
?>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2022-01-13
  • 2022-12-23
  • 2021-09-27
猜你喜欢
  • 2021-12-13
  • 2022-12-23
  • 2022-02-07
  • 2021-07-20
  • 2021-10-06
  • 2021-06-14
  • 2021-05-26
相关资源
相似解决方案