Rumah >pembangunan bahagian belakang >tutorial php > 问个正则表达式,如何排除<br>
问个正则表达式,怎么排除
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><?php $str = 'img我b有110www<br>有110110好呀'; echo preg_replace('/(img|110|b)/i', "<b>\${1}</b>", $str); ?>
'/(?<font color="#e78608">------解决方案--------------------</font><br>如果你需要考虑复杂点的情况,正则式就稍微复杂点,注意标签html标签内的img,110,b<br>
$str = '<img src="img/110/b.jpg" alt=" 问个正则表达式,如何排除<br> " >我img我b有110www<br>有110110好呀'; echo preg_replace('#(?=[^>]*(?=\1',$str); <div class="clear"> </div>