<?php
function smallpics($text){
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#sie","'
<a href=\'\\1'.str_replace(array('?','&','='),'','\\3').'\\4\' target=\'_blank\' title=\'click to enlarge\'>
<img src=\'\\1'.str_replace(array('?','&','='),'','\\3').'\\4\' style=\'border:0px\' width=\'100\' height=\'100\'>
</a>'",$text);
return $text;
}
?>
