Is there a PHP function to convert named HTML entities into their respective numeric HTML entities?
For example:
$str = \"Oggi è un bel&am
First use html_entity_decode to get the unencoded version of your source code. If necessary, set the third parameter (encoding) to the proper value.
Then use utf8_encode on that source code.
$source_code_without_entities = html_entity_decode($source_code_with_entities);
$utf8_source_code = utf8_encode($source_code_without_entities);