By default, PHP instruction MAGIC_QUOTES_GPC is on, and automatically runs Addslashes () for all GET, POST, and COOKIE data. Do not use Addslashes () for strings that have been MAGIC_QUOTES_GPC escaped, because this results in double-layer escaping. You can use the function GET_MAGIC_QUOTES_GPC () to detect this situation.
PHP Magic_quotes_gpc=on: We can not do the input and output database string data for addslashes () and stripslashes () operation, the data will be displayed normally.
When you addslashes () the input data, you must use Stripslashes () to remove the extra backslash when you output it.
PHP Magic_quotes_gpc=off: The input data is processed using addslashes (), but it is not necessary to format the output with Stripslashes () because addslashes () does not write the backslash together with the database. Just to help MySQL complete the execution of the SQL statement.
Magic_quotes_runtime escape characters: When you have some characters in your data that you want to write to the database, and you want to not be filtered out, it can be useful to add the characters in front of them.