如何去除文章内容中的文本网址?

WBOY
Release: 2016-06-23 14:01:47
Original
1807 people have browsed it

php 如何去除文章内容中的文本网址?不是超链接,只是文本,并且网址的URL是不固定的。


回复讨论(解决方案)

用正则匹配一下先,然后删除掉。
可以直接用preg_repalce("规则",'');替换成空相当于删除了。

不好理解,最好举例说明一下。

写个匹配不同url正则规则,替换即可,关键你要举出例子。

用正则过滤一遍就干净了

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