Collect php code that uses regular expressions to filter various labels, spaces, and line breaks:
$ Str = preg_replace ("/\ s +/", "", $ str); // filter excess carriage returns $ str = preg_replace ("/<[] +/si ", "<", $ str); // filter <__( "<" followed by a space) $ str = preg_replace ("/<\! -.*? ->/Si "," ", $ str); // comment $ str = preg_replace ("/<(\!. *?)> /Si "," ", $ str); // filter DOCTYPE $ str = preg_replace ("/<(\/? Html. *?)> /Si "," ", $ str); // filter html tags $ str = preg_replace ("/<(\/? Head. *?)> /Si "," ", $ str); // Filter head tags $ str = preg_replace ("/<(\/? Meta. *?)> /Si "," ", $ str); // filter meta tags $ str = preg_replace ("/<(\/? Body. *?)> /Si "," ", $ str); // filter the body Tag $ str = preg_replace ("/<(\/? Link. *?)> /Si "," ", $ str); // filter link tags $ str = preg_replace ("/<(\/? Form. *?)> /Si "," ", $ str); // Filter form tags $ str = preg_replace ("/cookie/si "," COOKIE ", $ str ); // filter COOKIE tags $ str = preg_replace ("/<(applet. *?)> (.*?) <(\/Applet. *?)> /Si "," ", $ str); // filter the applet tag $ str = preg_replace ("/<(\/? Applet. *?)> /Si "," ", $ str); // filter the applet tag $ str = preg_replace ("/<(style. *?)> (.*?) <(\/Style. *?)> /Si "," ", $ str); // filter the style tag $ str = preg_replace ("/<(\/? Style. *?)> /Si "," ", $ str); // filter the style tag $ str = preg_replace ("/<(title. *?)> (.*?) <(\/Title. *?)> /Si "," ", $ str); // filter the title Tag $ str = preg_replace ("/<(\/? Title. *?)> /Si "," ", $ str); // filter the title Tag $ str = preg_replace ("/<(object. *?)> (.*?) <(\/Object. *?)> /Si "," ", $ str); // filter the object tag $ str = preg_replace ("/<(\/? Objec. *?)> /Si "," ", $ str); // filter the object tag $ str = preg_replace ("/<(noframes. *?)> (.*?) <(\/Noframes. *?)> /Si "," ", $ str); // filter noframes tags $ str = preg_replace ("/<(\/? Noframes. *?)> /Si "," ", $ str); // filter noframes tags $ str = preg_replace ("/<(I? Frame. *?)> (.*?) <(\/I? Frame. *?)> /Si "," ", $ str); // filter the frame tag $ str = preg_replace ("/<(\/? I? Frame. *?)> /Si "," ", $ str); // filter the frame tag $ str = preg_replace ("/<(script. *?)> (.*?) <(\/Script. *?)> /Si "," ", $ str); // filter the script tag $ str = preg_replace ("/<(\/? Script. *?)> /Si "," ", $ str); // filter the script tag $ str = preg_replace ("/javascript/si "," Javascript ", $ str ); // filter the script tag $ str = preg_replace ("/vbscript/si", "Vbscript", $ str ); // filter the script tag $ str = preg_replace ("/on ([a-z] +) \ s * =/si", "On \ 1 = ", $ str); // filter script tags $ str = preg_replace ("// & #/si", "& #", $ str); // filter script tags
Articles you may be interested in
- PHP compresses html webpage code (clear spaces, line breaks, tabs, comment tags)
- Php converts multiple consecutive spaces in a string into one.
- Css controls code for force-breaking and non-wrapping in English and Chinese
- Common PHP anti-injection vulnerability filtering function code
- Php uses array_flip to implement array key-value exchange to remove array duplicate values
- Javascript shares the content with the code Summary of the websites on major social networking platforms
- How does php clear html format, remove spaces in text, and intercept text?
- Prohibit web page right-click, copy, save as, View Source file and other functions to implement web page source code protection