The Htmlspecialchars_decode () function is an inverse function of the htmlspecialchars () function.
htmlspecialchars () can be used to prevent XSS; Refer to: https://www.zhihu.com/question/27646993
Htmlspecialchars_decode () function
More examples of examples 1
To convert a predefined HTML entity to a character:
Do not convert any quotation marks?>
The HTML output of the above code is as follows (see source code):
<! DOCTYPE Html>
The browser output of the above code:
Bill & ' Steve ' Bill & ' Steve ' Bill & ' Steve '
Example 2To convert a predefined HTML entity to double quotes:
Convert double and single quotation marks?>
The HTML output of the above code is as follows (see source code):
<! DOCTYPE html>
The browser output of the above code:
I Love "PHP".
Htmlspecialchars () function:More examples of examples 1Convert some of the predefined characters to HTML entities:
Do not convert any quotation marks?>
The HTML output of the above code is as follows (see source code):
<! DOCTYPE Html>
The browser output of the above code:
Bill & ' Steve ' Bill & ' Steve ' Bill & ' Steve '
Htmlspecialchars () and Htmlspecialchars_decode ()