Php completely filters HTML, JS, CSS, and other labels. Remember to write an article in the past that filters html tags, js code, and css style tags effectively in php: Copy the code as follows :? Php $ strpreg_replace (@ script (.*?) Script @ is, $ str); $ str remember to write an article before
Php effectively filters html tags, js code, and css style tags:
The code is as follows:
$ Str = preg_replace ("@ $ Str = preg_replace ("@ is", "", $ str );
$ Str = preg_replace ("@ @ Is "," ", $ str );
$ Str = preg_replace ("@ <(. *?)> @ Is "," ", $ str );
?>
All are regular expressions used to filter HTML tags, but they are useless today. why ?? The tag is Escaped. for example
. This is displayed on the page. However, the source file is displayed as follows: "-- but we can still process it. first decompile all the content and then filter it out.
The code is as follows:
$ Str = htmlspecialchars_decode ($ str );
To use the htmlspecialchars_decode function, convert the source file to a tag like <>. then ":
The code is as follows:
$ Str = preg_replace ("/<(. *?)> /"," ", $ Str );
Php effectively filters html tags, js code, and css style tags: the code is as follows :? Php $ str = preg_replace ("@ script (.*?) /Script @ is "," ", $ str); $ str...