1. preg_replace ()
$ Msg = preg_replace ("/<style>. + <\/style>/is "," ", $ msg); ----- Delete <style> </style> and the middle part
$ Msg = preg_replace ("/<[^>] +>/", "", $ msg); ----- Delete <> and intermediate content
I (PCRE_CASELESS)
If this modifier is set, characters in the mode match both uppercase and lowercase letters.
S (PCRE_DOTALL)
If this modifier is set, the dot metacharacters (.) In the pattern match all characters, including line breaks. If this parameter is not set, line breaks are not included. This is equivalent to the/s modifier of Perl. For example, [^ a] Always matches a line break, regardless of whether this modifier is set.
2. ereg () and eregi ()
Note: The preg_match () function is usually a faster alternative than ereg ().
Eregi ("<body ([^>] +)> (. +) </body>", $ data, $ B) ---- check whether there is a body tag in $ data. If yes, assign $ B [0] to the parameter and $ B [1] to the intermediate part.
Bool ereg (string pattern, string [, array regs])
Int eregi (string pattern, string, array [regs])
Eregi () and ereg () are similar in usage. The difference is that ereg () is case sensitive, and eregi () is not case sensitive.