function re_htmlentities($html) { $arr = get_html_translation_table(HTML_ENTITIES); $arr = array_flip($arr); return strtr($html, $arr); }