note 90180 deleted from function.get-html-translation-table by googleguy

From: Date: Tue, 22 Oct 2013 12:15:02 +0000
Subject: note 90180 deleted from function.get-html-translation-table by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-197097@lists.php.net to get a copy of this message
Note Submitter: subweb007 at hotmail dot com ---- 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); ?>

« previous php.notes (#197097) next »