Home  >  Article  >  Backend Development  >  Change the URL into a hyperlink in the string_PHP tutorial

Change the URL into a hyperlink in the string_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:03:04875browse

$string = "Connect to http://www.phpx.com site";
//There needs to be a space or a carriage return after connecting.

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

print $string;

This is very useful.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/316408.htmlTechArticle$string = Connect to http://www.phpx.com site; //There needs to be a space or space after the connection Enter. $string =eregi_replace(http://([^ ,rn]*),a href=\0 target=_blank\0/a,$string); $string =ere...
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