/** * 获取跳转后的url * @param $url * @return mixed 定向后的url的真实url */ function get_real_url($url){ $header = get_headers($url,1); if (strpos($header[0],'301') || strpos($header[0],'302')) { if(is_array($header['Location'])) { return $header['Location'][count($header['Location'])-1]; }else{ return $header['Location']; } }else { return $url; } }
获取301跳转后的真实url
精选 转载
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
获取IP地址
端点(API接口)访问获取IP地址!
IP Java SpringBoot\ -
C# 获取IP和MAC地址
扫描局域网IP列表的几种方法很多软件都有获知局域网在线计算机IP的功
c# string object textbox exception