如何忽略此preg_replace中的html标记.我有搜索的foreach函数,所以如果有人搜索"apple span",preg_replace也会对span和html中断应用跨度:
preg_replace("/($keyword)/i","<span class=\"search_hightlight\">$1</span>",$str);
提前致谢!
html php preg-replace
html ×1
php ×1
preg-replace ×1