|
楼主 |
发表于 2024-4-13 17:34:47
|
显示全部楼层
function ip_curlGet($url)
{
$ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// 输出头
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_FALSESTART, true);
//模拟常用浏览器的 useragent
curl_setopt($ch, CURLOPT_USERAGENT, "{$ua}");
// 不跟随跳转
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
两段都没有效果 |
|