對象與像素的選獲得某個網頁上的所有超褳接

發表于:2007-07-14來源:作者:點擊數: 標簽:
html headtitle正則表達式/title/head body a href=./返回列表/abr form action=?echo $ PHP _SELF;? method=post URL:input type=text name=url value=?echo $url?input type=submit value=獲取所有褳接 /form ? if(isset($url)){ echo $url 有下列褳接:b


<html>
<head><title>正則表達式</title></head>
<body>
<a href="./">返回列表</a><br>
<form action="<?echo $PHP_SELF;?>" method="post">
URL:<input type="text" name="url" value="<?echo $url?>"><input type="submit" value="獲取所有褳接">
</form>
<?
if(isset($url)){
    echo "$url 有下列褳接:<br>";
    $fcontents = file($url);
    while(list(,$line)=each($fcontents)){
        while(eregi('(href[[:space:]]*=[[:space:]]*"?[[:alnum:]:@/._-]+"?)(.*)',$line,$regs)){
            $regs[1] = eregi_replace('(href[[:space:]]*=[[:space:]]*"?)([[:alnum:]:@/._-]+)("?)',"\\2",$regs[1]);
            echo "    $regs[1]<br>";
            $line = $regs[2];
        }
    }
}
?>
</body>
</html>

原文轉自:http://www.anti-gravitydesign.com

国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97