PHP Tip: Replace URLs With Links
January 6th, 2009 by MattI was trawling through the PHP function reference the other day, looking for some information on regular expressions, when I happened across this gem:
$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]”, “<a href=”
