allora, secondo voi come mai
codice:
$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, $message);
dove
codice:
$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#');
$html_entities_replace = array('&amp;', '&lt;', '&gt;');

$message = 'ciao "ciao" ciao';
e mi sostituisce i doppi apici con &quot;