There are two situations for magic_quotes_gpc, the first one is
magin_quotes_gpc=on
with magin_quotes_gpc=off
Let’s give examples below.:
When magin_quotes_gpc=on.
We can not perform addslashes() and stripslashes() operations on the string data input and output from the database, and the data will be displayed normally.
If you perform addslashes() on the input data at this time, you must use stripslashes() to remove excess backslashes when outputting.
2. For the case of magic_quotes_gpc=off
Addslashes() must be used to process the input data, but there is no need to use stripslashes() to format the output because addslashes() does not write the backslashes together into the database, but only helps mysql complete the execution of the sql statement.
Supplement:
The scope of magic_quotes_gpc is: WEB client server; the time of action: when the request starts, such as when the script is running.
magic_quotes_runtime Scope of action: Data read from a file or the result of executing exec() or obtained from a SQL query; Action time: Every time the script accesses data generated in the running state