htmlspecialchars_decode
Function • Params changed in PHP 8.1
Convert special HTML entities back to characters.
htmlspecialchars_decode Function synopsis
htmlspecialchars_decode(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401): string
Parameters
$string
Typestring
The string to decode.
$flags
OptionalTypeintDefault valueENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401
A bitmask of one or more of the following flags, which specify how to handle quotes and
which document type to use. The default is ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401.
$flags accepts one or a bitmask of the following constant values:
Return value
Typestring
Returns the decoded string.
Changes to the htmlspecialchars_decode Function
PHP 8.1
- Parameter default value changed for position #2 (
$flags):ENT_COMPATtoENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401
- htmlspecialchars_decode(string $string, int $flags = ENT_COMPAT): string
+ htmlspecialchars_decode(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401): string PHP 8.0
- Return type added:
string - Parameter type added for parameter #1 (
$string):string - Parameter name of parameter #2 changed:
$quote_styleto$flags - Parameter type added for parameter #2 (
$flags):int - Parameter default value added for position #2 (
$flags):ENT_COMPAT
- htmlspecialchars_decode($string, $quote_style)
+ htmlspecialchars_decode(string $string, int $flags = ENT_COMPAT): string htmlspecialchars_decode Function Availability
htmlspecialchars_decode Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Future Release | Yes |
| PHP 8.5Upcoming Release | Yes |
| PHP 8.4Supported (Latest) | Yes |
| PHP 8.3Supported | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Security-Fixes Only | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | Yes |
| PHP 7.0Unsupported | Yes |
| PHP 5.6Unsupported | Yes |
| PHP 5.5Unsupported | Yes |
| PHP 5.4Unsupported | Yes |
| PHP 5.3Unsupported | Yes |