abstract class Text { static $HTML_Table = array( '
' => '
', '
' => '
', '
' => '
', '
' => '
', '
' => '', ']*>`Usmi', "", $Txt); $Txt = preg_replace('`
`Usmi', "\n\n", $Txt); $Txt = str_replace(' ', '...', $Txt); $Txt = str_replace('…', '...', $Txt); $Txt = str_replace(''', "'", $Txt); $Txt = str_replace('’', "'", $Txt); $Txt = str_replace('”', '"', $Txt); $Txt = str_replace('‘', '"', $Txt); $Txt = str_replace('“', '"', $Txt); $Txt = preg_replace("`?font[^>]*>`Usmi", "", $Txt); $trans_tbl = get_html_translation_table (HTML_ENTITIES); $trans_tbl = array_flip ($trans_tbl); $Txt = strtr($Txt, $trans_tbl); $Txt = preg_replace("`([^ ])[ ]+([^ ])`smi", "\\1 \\2", $Txt); $Txt = preg_replace("`\n(\s)+(\S)`smi", "\n\\2", $Txt); if ($eTo == 'TEXT') { $Txt = strip_tags($Txt); } else if ($eTo == 'FPDF_HTML') { $Txt = preg_replace('`<(/?)strong[^>]*>`Usmi', '<\\1b>', $Txt); $Txt = preg_replace('`<(/?)em[^>]*>`Usmi', '<\\1i>', $Txt); } return trim($Txt); } } } function CleanHTML($v) { $v = stripslashes($v); $tx = preg_replace('` face="[^"]*"`Usm', '', $v); $tx = preg_replace('` class=[a-zA-Z]*([ >])"`Usm', '\\1', $tx); $tx = preg_replace('`]*)>`Usmi', '', $tx); $tx = preg_replace('` style="MARGIN:[^"]*"`Usm', '', $tx); $tx = preg_replace('`<(/?)div`Usm', '<\\1p', $tx); return preg_replace('`]*>(?[^>]*>)* (?[^>]*>)*
`Usmi', '', $tx); } function Upper($v) { $v = strtoupper($v); $v = strtr($v, 'àâäéèêëïîöôùüû', 'ÀÂÄÉÈÊËÏÎÖÔÙÜÛ'); return $v; } } ?>