3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = '<p>test test test&nbsp;</p><p><img src="http://static.adzerk.net/Advertisers/f380ecc42410414693b467ac7a97901b.png" style="width: 728px;"><br></p><p>test test</p><p><img src="http://static.adzerk.net/Advertisers/f380ecc42410414693b467ac7a97901b.png" style="width: 728px;"><br></p>'; $text = preg_replace("/<img[^>]+>/", "", $text); var_dump($text);

preferences:
146.14 ms | 405 KiB | 5 Q