note 51722 modified in function.html-entity-decode by danbrown
| From: | danbrown@php.net | Date: | Tue, 10 Jan 2012 20:14:56 +0000 |
| Subject: | note 51722 modified in function.html-entity-decode by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185546@lists.php.net to get a copy of this message | ||
To convert html entities into unicode characters, use the following:
<?php
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
foreach($trans_tbl as $k => $v)
{
$ttr[$v] = utf8_encode($k);
}
$text = strtr($text, $ttr);
?>
--was--
To convert html entities into unicode characters, use the following:
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
foreach($trans_tbl as $k => $v)
{
$ttr[$v] = utf8_encode($k);
}
$text = strtr($text, $ttr);
http://php.net/manual/en/function.html-entity-decode.php