Current Location: Home> Function Categories> htmlspecialchars_decode

htmlspecialchars_decode

Convert special HTML entities back to normal characters
Name:htmlspecialchars_decode
Category:String
Programming Language:php
One-line Description:Convert some predefined HTML entities into characters.

Definition and usage

The htmlspecialchars_decode() function converts predefined HTML entities into characters.

The HTML entity that will be decoded is:

  • & decoded into & (sum)
  • "Decoded into" (double quotes)
  • 'Decoded into' (single quotes)
  • < decoded to < (less than)
  • > Decode to > (greater than)

htmlspecialchars_decode() function is the inverse function of htmlspecialchars() function.

grammar

 htmlspecialchars_decode ( string , flags )
parameter describe
string Required. Specifies the string to be decoded.
flags

Optional. Specifies how to deal with quotes and which document type to use.

Available quote types:

  • ENT_COMPAT - Default. Decode only double quotes.
  • ENT_QUOTES - Decode double and single quotes.
  • ENT_NOQUOTES - No quotation marks are decoded.

Additional flags for the document type used:

  • ENT_HTML401 - Default. Process code as HTML 4.01.
  • ENT_HTML5 - Process code as HTML 5.
  • ENT_XML1 - Process code as XML 1.
  • ENT_XHTML - Process code as XHTML.
Similar Functions
  • Calculate the sha1 hash value of the file sha1_file

    sha1_file

    Calculatethesha1hash
  • Calculate the last occurrence of the specified string in the target string (case insensitive) strripos

    strripos

    Calculatethelastoccu
  • Find the last occurrence of a specified character in a string strrchr

    strrchr

    Findthelastoccurrenc
  • Output formatted string printf

    printf

    Outputformattedstrin
  • Convert the first letter of each word in the string to uppercase ucwords

    ucwords

    Convertthefirstlette
  • Calculate the soundex key of a string soundex

    soundex

    Calculatethesoundexk
  • Find any one of a set of characters in a string - Return a substring that starts with the found character strpbrk

    strpbrk

    Findanyoneofasetofch
  • Set the first character of the string to lowercase lcfirst

    lcfirst

    Setthefirstcharacter
Popular Articles