I've got a code that grabs any user input, looks for strings that begin with http:// or www and make those strings into a link, but the code stops if the links contain hyphens, question marks such as in php, or any other unsual character, can anybody help? here is the code, if you know of a better one please let me know, thanks:
$links =
preg_replace("/\b((http(s?):\/\/)|(www.))([\w.]+)([\/\w+.]+)\b/i",
"<a href=\"http$3://$4$5$6\"
target=\"_blank\"><font color=blue><b><u>$4$5$6$7</u></b></font></a>", $linka);
$content2 =
preg_replace("/([URL=)(http|https|ftp)(:\/\/\S+)(])(.+?)([\/URL])/"
, "<a href=\"\2\3\">\5
target=\"_blank\"</a>" , $links);
echo $content2;
if you are unsure about what i said, check out www.cafe-house.com, whereever there is a link, there is something broken in it.