当前位置:

php 获取跳转的Url真实地址

xiaoming 2023-01-19 144 0

function curl_post_302($url,$data=null) { $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // 获取转向后的内容 $data = curl_exec($ch); $Headers = curl_getinfo($ch); curl_close($ch); if($data != $Headers){ return $Headers["url"]; }else{ return false; } }

php 获取跳转的Url真实地址

发表评论

  • 评论列表
还没有人评论,快来抢沙发吧~
您是本站第9758名访客 今日有0篇新文章