复制代码 代码如下:
function showtext($text){
$search = array('|([^ ]+)|', '|(https://[^ ]+)|', '|([^ ]+)|');
$replace = array('<a href="$1" target="_blank">$1</a>', '<a href="$1" target="_blank">$1</a>', '<a href="http://$1" target="_blank">$1</a>');
$text = preg_replace($search, $replace, $text);
return $text;
}
新闻热点
疑难解答