Search code examples
phphtml-encode

Weird char (�) appears after doing html_entity_decode


In a separate YML file i have :
flags: [<img src="/images/cms_bo/icons/english.png" alt="English"/>]

When i call this into my code, it's not interpreted, so i used html_entity_decode.

It works but i have only 1 strange char just before my image :

<?php echo html_entity_decode($form['lang']->render()); ?>

All my files are UTF8 encoded. Do you have an idea on what i've missed to solve this problem ?

PS:

      public static function getI18nCulturesForChoice()
  {
      return array_combine(self::getI18nCultures(), self::getI18nCulturesFlags());
  }

Solution

  • Try using html_entity_decode($form['lang']->render(),ENT_QUOTES, "UTF-8");