$linktext = preg_replace('/\\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*/i', "<a href=\"\\0\" target=\"_blank\">\\0</a>", $linktext);