- Subject
- blah
- Author
- blah
- Description
- tgdagd
- Posted on
- Mon, 01 Mar 2010 08:38:02 +0100
- Content
-
<?php function autolink($url){ $url = str_replace("\\r","\r",$url); $url = str_replace("\\n","\n<BR>",$url); $url = str_replace("\\n\\r","\n\r",$url); $in = array('`((?:https?|ftp)://\S+[[:alnum:]]/?)`si','`((?<!//)(www\.\S+[[:alnum:]]/?))`si'); $out=array('<a href="$1" rel=nofollow>$1</a> ','<a href="http://$1" rel=\'nofollow\'>$1</a>'); return preg_replace($in,$out,$url); } ?>