统计在线人数...

正则表达式例子:获得某个网页上的所有超裢接

[ 来源:互联网 | 作者:佚名 | 时间:2008-9-3 上午 10:58:27 | 浏览:统计中... ]

<html>
<head><title>正则表达式</title></head>
<body>
<ahref="./">返回列表</a><br>
<formaction="<?echo$PHP_SELF;?>"method="post">
URL:<inputtype="text"name="url"value="<?echo$url?>"><inputtype="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>

共有0人参与评价,平均得分:0分
评论内容只代表网友观点,与本站立场无关! 查看完整内容
   

当前在线人数
QQ:748838 MSN:allen_xia#msn.com E-mail:allenxia666#126.com QQ群:站长联盟北方区-北京(28200145) 站长联盟南方区-上海(67713522)