$to_convert = '·'; $table = get_html_translation_table(HTML_ENTITIES); $equiv = '&#'.ord(array_search($to_convert,$table)).';';