-
function html2txt($document){
-
‘@<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;
-
}
Note
Il reste encore des améliorations à faire…