您好,欢迎访问一九零五行业门户网

PHP实现把文本中的URL转换为链接的函数

/*** author: seedz* from: http://code.seebz.net/p/autolink-php/**/function autolink($str, $attributes = array()) {$attrs = '';foreach ($attributes as $attribute=>$value) {$attrs .= {$attribute}=\{$value}\;}$str = ' '.$str;$str = preg_replace('`([^=\'>])((http|https|ftp|ftps)://[^\s< ]+[^\snofollow));echo $str; // http://example.com/?>
其它类似信息

推荐信息