Hi, Here are two routines for your problem. function htmlentities2($myHTML) { $translation_table=get_html_translation_table (HTML_ENTITIES,ENT_QUOTES); $translation_table[chr(38)] = '&'; return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($myHTML, $translation_table)); } function displaytextData($variable){ $variable = eregi_replace(""",'"',eregi_replace("&","&",eregi_replace("<","<",eregi_replace(">",">",htmlentities2($variable))))); $variable = trim($variable); return $variable; } Hopefully this will help a lot... Enjoy... ;) -- *** phpgurru.com <http://phpgurru.com> [A php resource provider] *** \\\|/// \\ - - // ( @ @ ) PHP is too logical for my brain +---oOOo-(_)-oOOo------------------------------------------+ | Mian Shafiq ur Rehman | phpgurru.com <http://phpgurru.com> [A php resource provider] | 107 B, New Town, Multan Road | Lahore Pakistan | | Mobile: 0300 423 9385 | | ooo0 http://www.phpgurru.com | ( ) 0ooo E-Mail: rehmanms@xxxxxxxxx +---\ (----( )------------------------------------------+ \_) ) / (_/