function decode_entities

decode_entities($text)

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>).

Parameters

$text: The text to decode entities in.

Return value

The input $text, with all HTML entities decoded once.

File

includes/unicode.inc, line 462
Provides Unicode-related conversions and operations.

Code

function decode_entities($text) {
  return html_entity_decode($text, ENT_QUOTES, 'UTF-8');
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!unicode.inc/function/decode_entities/7.x