View: Nettoyer une page HTML de ces balises

  1. 11 years ago by spawnrider
    1. function html2txt($document){
    2.         $search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript
    3.         '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
    4.         '@<[?]php[^>].*?[?]>@si', //scripts php
    5.         '@<[?][^>].*?[?]>@si', //scripts php
    6.         '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
    7.         '@<![\s\S]*?--[ \t\n\r]*>@', // Strip multi-line comments including CDATA
    8.         );
    9.         $text = preg_replace($search, '', $document);
    10.         return $text;
    11. }
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/411"></script>

2 comments about "Nettoyer une page HTML de ces balises"