可以用正则表达式来做,
这里给出我的方法:
function clean_html($code)
{
$code=preg_replace("/<a herf=\"(.+?)\" target=\"(.+?)\".+>(.+?)<\/a>.+/i","<a herf=\"\\1\" target=\"\\2\">\\3</a>",$code);
}
大概就是这个思路,,phpe.net上有吧,可能我写得不好用
这里给出我的方法:
function clean_html($code)
{
$code=preg_replace("/<a herf=\"(.+?)\" target=\"(.+?)\".+>(.+?)<\/a>.+/i","<a herf=\"\\1\" target=\"\\2\">\\3</a>",$code);
}
大概就是这个思路,,phpe.net上有吧,可能我写得不好用
Tealy(Tealy)兄你的方法我试了。。不行呀