Answer the question
In order to leave comments, you need to log in
How to do preg_replace for a tag containing an entry in PHP?
Hey!
There is an HTML page containing many tags.
<tag>lolo
ololo
lolo</tag>
<tag>ko
koko
ko</tag>
<tag>zaza
azaza
zaza</tag>
<tag>bom
terebon
bombom</tag>
<tag>zaza
azaza
zaza</tag>
#<tag>.*?azaza.*?<\/tag>#s
highlights text from the very first tag to the one containing the desired string:<tag>lolo
ololo
lolo</tag>
<tag>ko
koko
ko</tag>
<tag>zaza
azaza
zaza</tag>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question