Home > php教程 > php手册 > php 正则 过滤html 的超链接

php 正则 过滤html 的超链接

WBOY
Release: 2016-06-13 12:23:52
Original
806 people have browsed it

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

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template