Home >Backend Development >PHP Tutorial >在字符串中把网址改成超级链接_PHP

在字符串中把网址改成超级链接_PHP

WBOY
WBOYOriginal
2016-06-01 12:42:37892browse

$string = "连接http://www.phpx.com 站点";
//连接后需要有个空格或回车。

$string =  eregi_replace("http://([^ ,\r\n]*)","\\0",$string);
$string =  eregi_replace("ftp://([^ ,\r\n]*)","\\0",$string);

print $string;

这个可是非常有用的呀. 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn