用php写的将网址转换为超链接的函数
时间:2021-07-01 10:21:17
帮助过:4人阅读
- function showtext($text){
- $search = array('|(http://[^ ]+)|', '|(https://[^ ]+)|', '|(www.[^ ]+)|');
- $replace = array('$1', '$1', '$1');
- $text = preg_replace($search, $replace, $text);
- return $text;
- }
|