当前位置:Linux教程 - Php - php正则表达式,删除链接

php正则表达式,删除链接

<?
$lines_string
="123<a href="javascript:addOpenerOdds('+a[i][10]+')">444</a>456<a href="javascript:addOpenerOdds('+a[i][10]+')">555</a>789";
echo
"$lines_string";
//$lines_string=eregi_replace("<a([^>])*>"," ",$lines_string);
$lines_string=eregi_replace("<A[^>]*>[^<]*</a>"," ",$lines_string);
echo
"$lines_string";
?>
显示结果:
123<a href="javascript:addOpenerOdds('+a[i][10]+')">444</a>456<a href="javascript:addOpenerOdds('+a[i][10]+')">555</a>789

123 456 789