亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

相對路徑轉(zhuǎn)化成絕對路徑

 更新時(shí)間:2007年04月10日 00:00:00   作者:  
提取 Gregarius中的一個(gè)函數(shù)??梢园丫W(wǎng)頁中的相對路徑自動(dòng)轉(zhuǎn)化成絕對路徑。
<? 
function relative_to_absolute($content, $feed_url) { 
    preg_match('/(http|https|ftp):\/\//', $feed_url, $protocol); 
    $server_url = preg_replace("/(http|https|ftp|news):\/\//", "", $feed_url); 
    $server_url = preg_replace("/\/.*/", "", $server_url); 

    if ($server_url == '') { 
        return $content; 
    } 

    if (isset($protocol[0])) { 
        $new_content = preg_replace('/href="\//', 'href="'.$protocol[0].$server_url.'/', $content); 
        $new_content = preg_replace('/src="\//', 'src="'.$protocol[0].$server_url.'/', $new_content); 
    } else { 
        $new_content = $content; 
    } 
    return $new_content; 

?> 

相關(guān)文章

最新評論