$message = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:]\\1' . str_replace(' ', '%20', '\\3') . '[/img:]'", $message); Please help me to understand the script Thank upi in advance