<tr><td style="text-align: center;" bgcolor="#ebe9e4" height="24">12000元</td> </tr> <tr bgcolor="#ebe9e4"> <td colspan="4" height="24"> <div style="text-align: right;"><span style="color: rgb(0, 0, 0);">信息采集;09-11-13 制表:</span><a target="_blank" href="http://www.xxx.com.cn/"><span style="color: rgb(0, 0, 0);">某某</span></a><span style="color: rgb(0, 0, 0);">汽车网 </span><a href="http://www.xxx.com.cn/"><span style="color: rgb(0, 0, 0);">http://www.xxx.com.cn</span></a></div> </td> </tr>
以上是原始字符传.我想把带有采集 那个tr 一整行给替换为空.测试很多次没解决.所以在这里来发帖子了.求达人帮忙解决下.
以上是原始字符传.我想把带有采集 那个tr 一整行给替换为空.测试很多次没解决.所以在这里来发帖子了.求达人帮忙解决下.
$str=preg_replace('/<tr .*?>.*?信息采集.*?<\/tr>/','',$str);
echo $str;
就是把中间那个tr 去掉
结果变成
<tr><td style="text-align: center;" bgcolor="#ebe9e4" height="24">12000元</td> </tr> <tr><td style="text-align: center;" bgcolor="#ebe9e4" height="24">某某</td>