Home >Backend Development >PHP Tutorial >Php正则替换字符串

Php正则替换字符串

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:27:02949browse

htmlStr.().().().replace().replace().replace().replace()
return htmlStr.replaceAll("<script[^>]*?>[\\s\\S]*?</script>", "").replaceAll("<style[^>]*?>[\\s\\S]*?</style>", "").replaceAll("<[^>]+>", "").replace(" ", "").replace("\n", "").replace("\t", "").replace(" ", "");


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