note 90180 added to function.get-html-translation-table
| From: | subweb007 at hotmail dot com | Date: | Thu, 09 Apr 2009 08:29:53 +0000 |
| Subject: | note 90180 added to function.get-html-translation-table | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152990@lists.php.net to get a copy of this message | ||
This function will convert get_html_translation_table from a ISO-8859-1 string to UTF-8 string.
<?php
function translation_table_to_utf8($arTranslationtable)
{
//loop through the array and convert everything both keys and values
foreach($arTranslationtable as $charkey => $char)
{
$charkey = utf8_encode($charkey);
$arUTFchars[$charkey]= utf8_encode($char);
}
return $arUTFchars;
}
//get the translation table
$arSpecialchar = get_html_translation_table(HTML_ENTITIES);
//call the function to convert to utf-8
$arUTFchars = translation_table_to_utf8($arSpecialchar);
print_r($arUTFchars);
?>
----
Server IP: 213.249.64.162
Probable Submitter: 80.127.94.103
----
Manual Page -- http://www.php.net/manual/en/function.get-html-translation-table.php
Edit -- https://master.php.net/note/edit/90180
Del: integrated -- https://master.php.net/note/delete/90180/integrated
Del: useless -- https://master.php.net/note/delete/90180/useless
Del: bad code -- https://master.php.net/note/delete/90180/bad+code
Del: spam -- https://master.php.net/note/delete/90180/spam
Del: non-english -- https://master.php.net/note/delete/90180/non-english
Del: in docs -- https://master.php.net/note/delete/90180/in+docs
Del: other reasons-- https://master.php.net/note/delete/90180
Reject -- https://master.php.net/note/reject/90180
Search -- https://master.php.net/manage/user-notes.php