: This article mainly introduces php special character filtering. For more information about PHP tutorials, see.
1. the htmlspecialchars () function converts some predefined characters to the HTML entity function prototype: htmlspecialchars (string, quotestyle, character-set). the predefined characters are: & (and) become & "(double quotation marks) to" '(single quotation marks) to become' <(less than) to become <> (greater than) to become>
Bold text. "; echo htmlspecialchars ($ str);?> The HTML output of the above code is as follows (view the source code): This is someBoldText. the browser output of the above code: This is someBoldText.2. htmlspecialchars_decode () function converts some predefined HTML entities into characters (opposite to htmlspecialchars). function prototype: htmlspecialchars_decode (string, quotestyle)
Bold text. "; echo htmlspecialchars_decode ($ str);?> The HTML output of the above code is as follows (view the source code): This is someBoldText. the browser output of the above code: This is some bold text.
The above introduces php special character filtering, including some content, and hope to be helpful to friends who are interested in PHP tutorials.