Possible Duplicate:
Php: remove all tags, but “a href” in a text
Is there any way to strip out html tags using regex from a string but only keep the tag and associated styling?
For example:
<div>
<p>Blah blah blah <a href="xyz.com" style="blah blah">blah blah</a> blah blah</p> </div>
will give you:
Blah blah blah <a href="xyz.com" style="blah blah">blah blah</a> blah blah
Thanks for your help
Your best bet is to use
strip_tagsfunction with the second parameter: