$string = "连接http://www.phpx.com 站点";<br>
//连接后需要有个空格或回车。<br>
<br>
$string = eregi_replace("http://([^ ,\r\n]*)","<a href=\\0 target=_blank>\\0</a>",$string);<br>
$string = eregi_replace("ftp://([^ ,\r\n]*)","<a href=\\0 target=_blank>\\0</a>",$string);<br>
<br>
print $string;