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;
     }
 }

 

相关文章:

  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
  • 2021-09-27
  • 2021-08-05
  • 2022-01-04
猜你喜欢
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案