function decode_entities

7.x decode_entities($text)
5.x decode_entities($text, $exclude = array())
6.x decode_entities($text, $exclude = array())
8.x 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>).


$text: The text to decode entities in.

Return value

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

15 calls to decode_entities()
comment_submit in drupal/modules/comment/comment.module
Prepare a comment for submission.
DrupalWebTestCase::checkForMetaRefresh in drupal/modules/simpletest/drupal_web_test_case.php
Check for meta refresh tag and if found call drupalGet() recursively. This function looks for the http-equiv attribute to be set to "Refresh" and is case-sensitive.
drupal_html_to_text in drupal/includes/
Transforms an HTML string into plain text, preserving its structure.
FilterUnitTestCase::assertNoNormalized in drupal/modules/filter/filter.test
Asserts that text transformed to lowercase with HTML entities decoded does not contain a given string.
FilterUnitTestCase::assertNormalized in drupal/modules/filter/filter.test
Asserts that a text transformed to lowercase with HTML entities decoded does contains a given string.

... See full list

1 string reference to 'decode_entities'
filter_xss_bad_protocol in drupal/includes/
Processes an HTML attribute value and strips dangerous protocols from URLs.


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


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