First function: Strip_tags, remove HTML and PHP tags
Note: This function removes any HTML and PHP tag strings that are contained in the string. If the string of HTML and PHP tags are wrong, for example, less than the symbol, it will also return errors. This function and FGETSS () have the same function. FGETSS is to read the file from the file and remove the HTML and PHP tags.
Second function: Htmlspecialchars, convert special characters to HTML format
In detail, this function converts characters
& (and) turn into &
"(double quotation marks) turn into "
< (less than) turn into <
> (greater than) turn into >
Third function: Htmlentities, convert all characters to HTML string
Maybe you're still sorry htmlspecialchars can only handle 4 HTML tags, now you do not regret, htmlentities is to convert all characters. Not all powerful, but it doesn't make much sense to me.
The fourth function: Stripslashes and addslashes are a pair, addslashes is using a backslash reference string, Stripslashes is a string that restores addslashes references.
This function is generally a necessary step before a database query, which is preceded by a backslash in order for the database query statement to be preceded by some characters. These characters are single quotes ('), double quotation marks ("), backslashes (\), and NUL (the NULL character).
PHP htmlspecialchars, strip_tags, addslashes explanations