Php Function to convert latin char (special char) into html

by Subramanian 2014-03-07 18:39:45

Php Function to convert latin char (special char) into html :

function convertLatin1ToHtml($str)
{
$allEntities = get_html_translation_table(HTML_ENTITIES, ENT_NOQUOTES);
$specialEntities = get_html_translation_table(HTML_SPECIALCHARS, ENT_NOQUOTES);
$noTags = array_diff($allEntities, $specialEntities);
$str = strtr($str, $noTags);
return $str;
}
1083
like
0
dislike
0
mail
flag

You must LOGIN to add comments