Highlight text, except html tags

前端 未结 3 548
抹茶落季
抹茶落季 2021-01-18 06:26

I\'m using the code below to highlight some keywords in a text:

$message = str_ireplace($words,\'\'.$words.\'         


        
3条回答
  •  醉酒成梦
    2021-01-18 07:17

    Use a DOM parser of some sort. This is not something you want to do with regex.

提交回复
热议问题