I'm spooling out some content from the DB and some of these content might have image but I need to just extract only the text content without echoing any image that might be within the content.

**Sample:**

```
   $nws = '<h3>Just text Just text Just text Just text Just text Just text.</h3>

    <p><img alt="" src="/opt_file/images/09062013C-pix1.jpg" style="width: 400px; height: 231px;" /></p>

<img alt="" src="/opt_file/images/another-pix2.png" style="width: 300px; height: 150px;" />

    <p>Just text Just text Just text Just text Just text Just text.</p>

    <p>Just text Just text Just text Just text Just text Just text.</p>

    <p><strong>Sure these are just text.</strong></p>';

    $nws = str_replace( '<img alt="" src="" />', "" , $nws );

    echo $nws;

```

I tried using str\_replace to rip off any image tag or images within but it just won't work.

Also, these content and image are dynamic and there are chances a specific might have multiple image.

Really need to fix this and would be very grateful getting help.

Thanks!