Home >Backend Development >PHP Tutorial >正则婚配非超链接的url

正则婚配非超链接的url

WBOY
WBOYOriginal
2016-06-13 10:32:04875browse

正则匹配非超链接的url
现在我能获取所有链接,但问题是:我要过滤掉超链接和img中的url,那要如何编写正则呢?

------解决方案--------------------
echo preg_replace('/http:\/\/.+/i','\0',strip_tags($s));

------解决方案--------------------
否定断言href就好了。
------解决方案--------------------
前否href=“,后否”。

手机无力,没代码。

Statement:
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