正则表达式例子获得某个网页上的所有超裢接_PHP教程
时间:2021-07-01 10:21:17
帮助过:9人阅读
正则表达式返回列表
if(isset($url)){
echo "$url 有下列裢接:
";
$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]
";
$line = $regs[2];
}
}
}
?>
http://www.bkjia.com/PHPjc/531998.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/531998.htmlTechArticle正则表达式 返回列表 if(isset($url)){ echo "$url 有下列裢接: "; $fcontents = file($url); while(list(,$line)=each($fcontents)){ while(eregi((href[[:space:]]*=[[:space...