Thursday, 15 May 2014

php - Remove blockquotes from string? -



php - Remove blockquotes from string? -

this question has reply here:

php: strip specific tag html string? 6 answers

i've php string this:

i <blockquote> <strong>string</strong> <blockquote> lot of</blockquote> in <a href="#">it</a> </blockquote> hiya!

and need remove blockquotes transform in:

i hiya!

i think regex can usefull can't find on stackoverflow nor on google , don't know how write myself that.

can tell me how using php?

(i found this, isn't regex , don't know if can remove html element too. using php remove html element string)

try this

$out=preg_replace("~<blockquote(.*?)>(.*)</blockquote>~si","",' '.$str.' ');

php regex string

No comments:

Post a Comment