如何去掉html中的超链接
$a= ' 哈哈 ';
我想最后只输出 哈哈
——解决方案——————–
http://community.gaodaima.com/Expert/topic/5686/5686639.xml?temp=.6129724
不写了,你自己参考一下吧。同样的题目
——解决方案——————–
正
。本文来源gao!%daima.com搞$代*!码网1
搞代gaodaima码则表达式
$a= ' 哈哈 ';
$a= preg_replace( “/ ]+> / “, ” “, $a);
$a= preg_replace( “/ / “, ” “, $a);
——解决方案——————–
$a= preg_replace( “/ ]+> / “, ” “, $a);
$a= preg_replace( “/ / “, ” “, $a);
——————-
干吗替换两遍?
$a= preg_replace( “/ ]*> / “, ” “, $a);
——解决方案——————–
——————-
干吗替换两遍?
$a= preg_replace( “/ ]*> / “, ” “, $a);
———————————————–
只能去掉 。
应该:
$a= preg_replace( “/ ]+> / “, ” “, $a);
$a= preg_replace( “/ <\/a> / “, ” “, $a);//注意:是 “/ <\/a> / “,不是 “/ / “.