",$html); $html = str_replace("˘","¢",$html); $html = str_replace("Ł","£",$html); $html = str_replace("€","€",$html); $html = str_replace("Ą","¥",$html); $html = str_replace("™","™",$html); $html = str_replace("©","©",$html); $html = str_replace("®","®",$html); return $html; } function txtentities($html){ $trans = get_html_translation_table(HTML_ENTITIES); $trans = array_flip($trans); return strtr($html, $trans); } function AdjustHTML(&$html,$usepre=true) { //Try to make the html text more manageable (turning it into XHTML) $html = str_replace("\r\n","\n",$html); //replace carriagereturn-linefeed-combo by a simple linefeed if ($usepre) //used to keep \n on content inside
or ",$html); //restore
// (the code above might slowdown overall performance?)
} //if ($usepre)
else
{
$html = str_replace("\f",'',$html); //replace formfeed by nothing
$html = str_replace("\r",'',$html); //replace carriage return by nothing
$html = str_replace("\n",'',$html); //replace linefeed by nothing
$html = str_replace("\t",' ',$html); //replace tabs by spaces
}
$html = str_replace("< IMPRIMIR >",'',$html); //remover especial desta versão
$regexp = '/\\s{2,}/s'; // turn 2+ consecutive spaces into one
$html = preg_replace($regexp,' ',$html);
//Avoid crashing the script on PHP 4.0
$version = phpversion();
$version = str_replace('.','',$version);
if ($version >= 430) $html = html_entity_decode($html); // changes and the like by the respective char
else $html = lesser_entity_decode($html);
// remove redundant
's before , avoiding huge leaps between text blocks
// they appear on computer-generated HTML code
$regexp = '/(
)+?<\/div>/si';
$html = preg_replace($regexp,'',$html);
}
?>