preg_replace替换a标签 <a href="http://" style="line-height:27px;color:#444547;margin-right:12px;display:none">更多</a>怎么写正则,要求a标签样式里出现display:none就把a标签替换成空 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $s = <<< TXT<a href="http://" style="line-height:27px;color:#444547;margin-right:12px;display:lock">更多</a><a href="http://" style="line-height:27px;color:#444547;margin-right:12px;display:none">更多</a><a href="http://" style="line-height:27px;color:#444547;margin-right:12px;">更多</a>TXT;echo preg_replace('/<a[^>]*(?=display:none).+?<\/a>/is','',$s); 关于数据类型的基础问题 继续谈php手册的中文翻译... PHP考试题 敢问大大大们这个链接跳转时 如何实现的 php连接oracle出错 "TNS: 协议适配器错误" 寻简单模板.... smarty实例教学(原创) 实例篇(一) 大家帮忙看看这个分页函数该怎么改啊,头疼死了 基于web服务器日志的访问流量统计 使用组件发送邮件! 请问如何查询包含某字符的所有记录 求用php打开本地exe文件的方法
<a href="http://" style="line-height:27px;color:#444547;margin-right:12px;display:lock">更多</a>
<a href="http://" style="line-height:27px;color:#444547;margin-right:12px;display:none">更多</a>
<a href="http://" style="line-height:27px;color:#444547;margin-right:12px;">更多</a>
TXT;
echo preg_replace('/<a[^>]*(?=display:none).+?<\/a>/is','',$s);