PHP头条
热点:

php获取网页301真实地址-PHP源码


PHP代码

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

www.phpzy.comtrue/php/34674.htmlTechArticlephp获取网页301真实地址-PHP源码 PHP代码 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[Lo...

相关文章

PHP之友评论

今天推荐