时间:2021-07-01 10:21:17 帮助过:28人阅读
function showtext($text){
$search = array('|(http://[^ ]+)|', '|(https://[^ ]+)|', '|(www.[^ ]+)|');
$replace = array('$1', '$1', '$1');
$text = preg_replace($search, $replace, $text);
return $text;
}
http://www.bkjia.com/PHPjc/324307.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/324307.htmlTechArticle 代码如下:
function showtext($text){ $search = array('|(http://[^ ]+)|', '|(https://[^ ]+)|', '|(www.[^ ]+)|'); $replace = array('a href="$1" target="_blank"$1/a',...