$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#sie","'<span style=\'display: block; overflow: auto;\' class=\'forum-img-wrapper\'><img src=\'\\1'.str_replace(array('?','&','&','='),'','\\3').'\\4\' alt=\'\\3\\4\' style=\'border:0px\' class=\'forum-img\' /></span>'",$text);
?>