[PHP] 纯文本查看 复制代码 <?php
function https($url,$referer="",$post=array()){
$c=curl_init();
curl_setopt($c,CURLOPT_URL,$url);
if($post)curl_setopt($c,CURLOPT_POSTFIELDS,http_build_query($post));
if($referer)curl_setopt($c,CURLOPT_REFERER,$referer);
curl_setopt($c,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36');
curl_setopt($c,CURLOPT_HEADER,0);
curl_setopt($c,CURLOPT_RETURNTRANSFER,1);
curl_setopt($c,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($c,CURLOPT_SSL_VERIFYHOST,false);
$html=curl_exec($c);
curl_close($c);
return $html;
}
$start=microtime(true);
$html=https(base64_decode("aHR0cHM6Ly9jai5semlhcGkuY29tL2FwaS5waHAvcHJvdmlkZS92b2QvP2FjPXZpZGVvbGlzdCZ3ZD0lRTUlQTQlQTclRTUlODYlQjMlRTYlODglOTg="));
$end=microtime(false);
echo "length:".strlen($html)."<br>";
echo "time:".(microtime(true)-$start)."s";
length:34078
time:0.62203598022461s
我试了试我的 用时0.62秒左右 代码差不多 这个是不是跟网速有关呀 |