Check out preg_replace.
You can do something along these lines:
$text = "xxxx"; / the text you want to create links in /
$text = preg_replace("/\b((http(s?):\/\/)|(www.))([\w.]+)([\/\w+.]+)([\S.]+)/i", "<a href=\"http$3://$4$5$6$7\" target=\"_new\">$2$4$5$6$7</a>", $text);
That should make links out of anything starting with 'http://', 'https://', or just 'www'
-- Jason