在字符串中把网址改成超级链接
AI摘要
由 AI 生成 · 仅供参考
在字符串中把网址改成超级链接,$string=quot;连接http://www.phpx.com站点quot;;//连接后需要有个空格或回车。$string=nbsp;nbsp;eregi_replacequot;http://[^,\r\n]*quot;,quot;lt;ahref=\\0target=_blankgt;\\0lt;/agt;quot;,$string;$string=nbsp;nbsp;eregi_replacequot;ftp://[^,\r\n]*quot;,qu..
$string = "连接http://www.phpx.com 站点";
//连接后需要有个空格或回车。
$string = eregi_replace("http://([^ ,\r\n]*)","<a href=\\0 target=_blank>\\0</a>",$string);
$string = eregi_replace("ftp://([^ ,\r\n]*)","<a href=\\0 target=_blank>\\0</a>",$string);
print $string;
这个可是非常有用的呀.
版权声明:本文由驱动中国整理发布,转载需注明出处与原文链接。如有疑问请联系
editor@qudong.com。
本文价值
★★★★★
—
成为第一个评分的人
登录后为本文打分
评论加载中…