PHP头条
热点:

php中将网址转换为超链接的函数


代码如下:
function showtext($text){
$search = array('|(http://[^ ]+)|', '|(https://[^ ]+)|', '|(www.[^ ]+)|');
$replace = array('$1', '$1', '$1');
$text = preg_replace($search, $replace, $text);
return $text;
}

www.phpzy.comtrue/phpyy/20012.htmlTechArticlephp中将网址转换为超链接的函数 代码如下: function showtext($text){ $search = array('|(http://[^ ]+)|', '|(https://[^ ]+)|', '|(www.[^ ]+)|'); $replace = array('$1', '$1', '$1'); $text = preg_replace($search, $replace, $text)...

相关文章

PHP之友评论

今天推荐