The following is the program code: Copy code The code is as follows: function uht($str) { $farr = array( "/s+/", //Filter excess white space//Filter and other codes that may introduce malicious content or maliciously change the display layout, if there is no need to insert flash Wait, you can also add the filter of <object><br>"/<(/?)(script|i?frame|style|html|body|title|link|meta|?|%)([^> ]*?)>/isU", <br>"/(<[^>]*)on[a-zA-Z]+s*=([^>]*>)/isU" ,//Filter the on event of javascript <br>); <br>$tarr = array( <br>" ", <br>"<123>",//If you want to directly clear unsafe tags, you can leave them here Empty<br>"12", <br>); <br>$str = preg_replace( $farr,$tarr,$str); <br>return $str; <br>} <br> </div> <p align="left"></p> <div style="display:none;"> <span id="url" itemprop="url">http://www.bkjia.com/PHPjc/319278.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/319278.html</span><span id="genre" itemprop="genre">TechArticle</span><span id="description" itemprop="description">The following is the program code: Copy the code as follows: function uhtl($str) { $farr = array( "/ s+/", //Filter excess white space//Filter scripts, etc. that may introduce malicious content or maliciously change the display...</span> </div> <div class="art_confoot"></div>