PHP 字符串正则替换函数preg_replace使用说明
1. preg_replace()
$msg = preg_replace("/和中间的部分
$msg = preg_replace("/]+>/", "", $msg); -----是删除和中间的内容
i (PCRE_CASELESS)
如果设定此修正符,模式中的字符将同时匹配大小写字母。
s (PCRE_DOTALL)
如果设定了此修正符,模式中的圆点元字符(.)匹配所有的字符,包括换行符。没有此设定的话,则不包括换行符。这和 Perl 的 /s 修正符是等效的。排除字符类例如 [^a] 总是匹配换行符的,无论是否设定了此修正符。
2. ereg()与eregi()
注: preg_match() 函数通常是比 ereg() 更快的替代方案
eregi("
bool ereg ( string pattern, string string [, array regs] )
int eregi ( string pattern, string string, array [regs] )
eregi()和 ereg() 类似,用法也相同。不同之处在于ereg()有区分大小写,eregi()与大小写无关。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version
Recommended: Win version, supports code prompts!
