<?php
error_reporting(0);
header('Access-Control-Allow-Origin:*');
header('Content-type:text/html;charset=gb2312');
if($_GET['url'] ){
//header('Content-type: application/json');
echo $_GET['url'];
// echo curl($_GET['url']);
}
?>
<?php
function curl($url)
{
/*if($pn){
$pn= "&pn=".(($pn*50)-50);
}else{
$pn= "";
}*/
//$url = "https://www.baidu.com/s?ie=utf8&wd=". urlencode($url) ."&rn=50".$pn;
set_time_limit(0);
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 Safari/537.36 SE 2.X MetaSr 1.0");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_MAXREDIRS,20);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 40);
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
curl_close($ch);
//preg_match('/<title>(.*?)<\/title>/is', $result, $matches);
//return $matches[1];
return $result;
}
?>
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询