I remember writing an article before php effectively filters html tags, js code, css style tags: Copy the code The code is as follows: $str = preg_replace( "@@is", "", $str ); <br>$str = preg_replace( "@<iframe(.*?)</iframe>@is", "", $str ); <br>$str = preg_replace( "@<style(.*?)</style> ;@is", "", $str ); <BR>$str = preg_replace( "@<(.*?)>@is", "", $str ); <br>?> <br> </div> <br> are all regular filtering HTML tags, but today they are not easy to use. The reason is that the tags are escaped. For example, <br >. This is what is displayed on the page. But the source file is displayed like this: "——But we can still deal with it, first decompile all the contents. Then filter it. <br><div class="codetitle"> <span style="CURSOR: pointer" onclick="doCopy('code16883')"><u>Copy code</u></span> The code is as follows: </div> <div class="codebody" id="code16883"> <br>$str= htmlspecialchars_decode($str); <br> </div> <br>Using the htmlspecialchars_decode function is to convert the source file into a tag like <>. Then": <br><div class="codetitle"> <span style="CURSOR: pointer" onclick="doCopy('code94856')"><u>Copy code</u></span> The code is as follows:</div> <div class="codebody" id="code94856"> <br>$str= preg_replace("/<(.*?)> ;/","",$str); <br> </div> <p align="left"></p> <div style="display:none;"> <span id="url" itemprop="url">http://www.bkjia.com/PHPjc/319819.html</span><span id="indexUrl" itemprop="indexUrl">www.bkjia.com</span><span id="isOriginal" itemprop="isOriginal">true</span><span id="isBasedOnUrl" itemprop="isBasedOnUrl">http: //www.bkjia.com/PHPjc/319819.html</span><span id="genre" itemprop="genre">TechArticle</span><span id="description" itemprop="description">I remember I wrote an article before that php can effectively filter html tags, js code, css style tags: Copy code code As follows: ?php $str = preg_replace( "@script(.*?)/script@is", "", $str ); $str...</span> </div> <div class="art_confoot"></div>