Search code examples
phpxmlcharacter-encodinghtmlspecialchars

Invalid Characters not displaying


I have an xml feed which i cannot edit, its remote.

Now when i import it to db

it says this:

A taste of Turkey for £21 10 Meze dishes, bread and drinks for two at Cirrik Fulham

but is outputting this:

A taste of Turkey for £21 –10 Meze dishes, bread and drinks for two at Cirrik Fulham

Is there a php function i can use to fix this tried htmlspecialchars() and htmlentities() no luck.


Solution

  • use

    echo mb_convert_encoding($string_from_db, 'HTML-ENTITIES', 'UTF-8');