1, the use of this function and php.ini in the configuration of the MAGIC_QUOTES_GPC, by default, this configuration is on. Also, this configuration is at a higher level and cannot be modified in the script. Therefore, it is important to detect this configuration situation.
2, in the script, although the MAGIC_QUOTES_GPC can not be configured, but the GET_MAGIC_QUOTES_GPC () function can be detected, return 1, indicating that php.ini is on, otherwise off.
3, MAGIC_QUOTES_GPC is on, the function of the addslashes () function is automatically implemented, for example, when you enter a string containing single quotation marks ('), double quotation marks ("), backslash (\) and click on the Submit button, the symbols are automatically preceded by" \ ". Of course, if you do not submit a string after the text box, you need to implement the effect with a backslash, you must manually use the Addslashes () function.
4. What is the use of a backslash? This should refer to the output of the string. In a script, the output of a string is generally in two ways. One direct echo, and the other inserts into the database. For the previous output, the backslash is useless and must be filtered out with the Stripslashes () function (a bit superfluous), but the backslash is useful for the latter insert into the database.
5, database access to the data do not explore, anyway, you know: with single quotation marks ('), double quotation marks ("), backslash (\) string, only with a backslash in the database, and then read out is the normal data.