I'm trying to transform the link of an image into the image within the tag, however I'm having difficulties when the image exists, the same I try to do with the link
In case I use the code below
$reply = preg_replace('#((http://|https://|//)([^\s]*)\.jpg|gif|png|JPG))#',
'<img src="$1" alt="" width="" height="" />', $data['reply']);
It works great when the link is posted like this
http://wallpaper.ultradownloads.com.br/276255_Papel-de-Parede-Meme-Obama-Not-Bad_1280x1024.jpg
but if there is something like this in the text
<img src="http://wallpaper.ultradownloads.com.br/276255_Papel-de-Parede-Meme-Obama-Not-Bad_1280x1024.jpg" >
It will try to transform too, how could I do?