I have the following code being echoed:
[caption id="attachment_13" align="alignnone" width="235" caption="Event 1"]
<img src="image.png" />
[/caption]
I only want the img tag to be echoed.
I've tried using <?php echo strip_tags($value, '<img>'); ?> but because the [caption] tag isn't actually a proper HTML tag I don't know how to remove it. Is there a function which will remove the text from a string?
Would str_replace work?