php 获取301 302的真实地址
生活随笔
收集整理的這篇文章主要介紹了
php 获取301 302的真实地址
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
function getRealURL($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;}}
?
轉載于:https://www.cnblogs.com/hubing/p/3183790.html
總結
以上是生活随笔為你收集整理的php 获取301 302的真实地址的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JS判断访问设备(userAgent)加
- 下一篇: 1,php概述