Home  >  Article  >  Backend Development  >  如何用PHP来过滤输入的内容中包含的元字符

如何用PHP来过滤输入的内容中包含的元字符

WBOY
WBOYOriginal
2016-06-13 13:42:441217browse

怎么用PHP来过滤输入的内容中包含的元字符
怎么用PHP来过滤输入的内容中包含的元字符

------解决方案--------------------
需要过滤什么元字符使用\来解决 例如 '/\?+/',$str


------解决方案--------------------
洒家对此极为擅长。洒家来助你。
好汉,你要实现何功能?

正则表达式
()
贪婪.*
不贪婪.*?
安行u
区分大小写i



查找用preg_match(正则,目标,结果仍一数组)
替换用preg_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