|
<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. = eregi_replace('(href[[:space:]]*=[[:space:]]*"?)([[:alnum:]:@/._-]+)("?)',"\\2",$regs.);
echo " $regs.<br>";
$line = $regs.;
}
}
}
?>
</body>
</html>
更多精彩:学习网->http://www.haohao888.com.cn 网络编程->http://www.51wlpc.com 电脑设备->http://www.xpmaster.cn
|