I would like to remove img tag completely with any attribute or styling from a string using preg_replace
$content= "image to remove completely <img src="jem.jpg" style="height:162px; width:397px" />";
This is something with in it.
I tried using preg_replace
, but it didn't work.
$content= "image to remove completely <img src="jem.jpg" style="height:162px; width:397px" />";
$content = preg_replace("/<img[^>]+\>/i", " ", $content );
expected output: image to remove completely