English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP String Character String Functions Manual
The html_special_chars_decode() function is used to convert special HTML entities back to normal characters.
string htmlspecialchars_decode ( string $string[, int $flags = ENT_COMPAT | ENT_HTML401 ] )
It is used to convert special HTML entities back to characters.
Note: The function performs the opposite action of htmlspecialchars(). It converts special HTML entities back to normal characters.
The following HTML entities will be decoded:
& Decoded to & (ampersand)
" Decoded to \
' Decoded to ' (single quote)
< Decoded to < (less than)
> Decoded to > (greater than)
It returns the decoded string.
Serial Number | Parameters and Description |
---|---|
1 | string String to be decoded |
2 | flags Specify how quotes are handled and which document type is used.Available quote types:
Additional flags for specifying the document type to use:
|
Try the following example to convert predefined HTML entities to double quotes
<?php //Predefined HTML Entities Converted to Double Quotes $str = "<p>"oldtoolbag.com" -> </p>\n"; echo htmlspecialchars_decode($str); ?>Test and See‹/›
Output Result-
"oldtoolbag.com" ->