note 83874 added to function.get-html-translation-table
| From: | LiamMorland at osu1 dot php dot net | Date: | Mon, 16 Jun 2008 15:57:29 +0000 |
| Subject: | note 83874 added to function.get-html-translation-table | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140505@lists.php.net to get a copy of this message | ||
Here is a simple way to convert named character entities to numeric character entities:
<?php
function numeric_entities($string){
$mapping = array();
foreach (get_html_translation_table(HTML_ENTITIES, ENT_QUOTES) as $char => $entity){
$mapping[$entity] = '&#' . ord($char) . ';';
}
return str_replace(array_keys($mapping), $mapping, $string);
}
?>
----
Server IP: 66.207.199.35
Probable Submitter: 129.97.32.57
----
Manual Page -- http://www.php.net/manual/en/function.get-html-translation-table.php
Edit -- https://master.php.net/note/edit/83874
Del: integrated -- https://master.php.net/note/delete/83874/integrated
Del: useless -- https://master.php.net/note/delete/83874/useless
Del: bad code -- https://master.php.net/note/delete/83874/bad+code
Del: spam -- https://master.php.net/note/delete/83874/spam
Del: non-english -- https://master.php.net/note/delete/83874/non-english
Del: in docs -- https://master.php.net/note/delete/83874/in+docs
Del: other reasons-- https://master.php.net/note/delete/83874
Reject -- https://master.php.net/note/reject/83874
Search -- https://master.php.net/manage/user-notes.php