Home > Backend Development > PHP Tutorial > php 正则 过滤html 的超链接_php实例

php 正则 过滤html 的超链接_php实例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:26:20
Original
796 people have browsed it

echo preg_replace("/(?]*)(?=\>)/i","#", "你好,点这里看看你好,点这里看看");
?>
正则:/(?]*)(?=\>)/
(?(?=exp) 匹配exp前面的位置
此正则 匹配 在 href= 之后 “>” 之前 的 非 “>” 的所有字符
例子:
找到这些字符(url)用 # 替换,就可以去掉html里的所有链接。

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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template