I have a text like this <text **** display="none">****</text> any words and htmlcodes <text **** display="none">****</text>
I want to remove all the string like this <text **** display="none">****</text>
,begin with <text
, end with </text>
contain with display="none"
.
Asked
Active
Viewed 160 times
0

Michael Berkowski
- 267,341
- 46
- 444
- 390

lpc2138
- 15
- 5
-
http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 – Bobby Jack Mar 16 '12 at 00:11
-
Is this well-formed XML or HTML? – Michael Berkowski Mar 16 '12 at 00:17
1 Answers
0
what about this?
$solution = preg_replace("@<text[^>]*display=\"none\"[^>]*>.*?</text>@ims", "", $yourstring);

David Frank
- 5,918
- 8
- 28
- 43