\decode_entities
function
Decodes all HTML entities (including numerical ones) to regular UTF-8 bytes.

Decodes all HTML entities (including numerical ones) to regular UTF-8 bytes.

Double-escaped entities will only be decoded once ("&amp;lt;" becomes "&lt;" , not "<"). Be careful when using this function, as decode_entities can revert previous sanitization efforts (&lt;script&gt; will become <script>).

Comments

ranelpadon’s picture

naveenvalecha’s picture

This function has been moved to String utility Component
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Utility!Stri...

edurenye’s picture

Not anymore, now this function has been moved to Html utility Component:
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Utility!Html...