Maison  >  Article  >  développement back-end  >  在字符串中把网址改成超级链接_PHP教程

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

WBOY
WBOYoriginal
2016-07-21 16:03:04872parcourir

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

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

print $string;

这个可是非常有用的呀. 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/316408.htmlTechArticle$string = 连接http://www.phpx.com 站点; //连接后需要有个空格或回车。 $string =eregi_replace(http://([^ ,\r\n]*),a href=\\0 target=_blank\\0/a,$string); $string =ere...
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn