function html2txt($document){
$search =
array('@<script[^>]*?>.*?</script>@si',
// Strip out javascript
'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
'@<[?]php[^>].*?[?]>@si', //scripts php
'@<[?][^>].*?[?]>@si', //scripts php
'@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
'@<![\s\S]*?--[ \t\n\r]*>@', // Strip multi-line comments including CDATA
);
return $text;
}
2 comments about "Nettoyer une page HTML de ces balises"
nephiston on November 19, 2007
palleas on March 25, 2008