网址自动加链接和ubb代码冲突的有关问题,如何解决

WBOY
Release: 2016-06-13 11:31:56
Original
1012 people have browsed it

网址自动加链接和ubb代码冲突的问题,怎么解决?
preg_replace("#((mms|http|https|ftp|telnet)(://)[.:@/\w\?\=\-\&\_\#\;\%\,\!\+]+)#i","\\1",$text);

上面是给一段文字里面的网址自动加链接的,但是有的ubb代码的链接不能自动加链接,要怎么排除?因为ubb会自动转换为链接。
比如这个:http://bbs.csdn.net/topics/new?forum_id=PHPBase
怎么排除有[url]或者[img]这种标签里面的链接不要自动加链接?或者有没有其它正则可以做到?
谢谢!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!