note 84623 modified in function.get-html-translation-table by danbrown
| From: | danbrown@php.net | Date: | Tue, 22 Jul 2008 15:20:00 +0000 |
| Subject: | note 84623 modified in function.get-html-translation-table by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142499@lists.php.net to get a copy of this message | ||
I found this useful in converting latin characters
<?php
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;
}
?>
--was--
I found this useful in converting latin characters
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;
}
http://php.net/manual/en/function.get-html-translation-table.php