When working with MySQL and get, post data, it is often necessary to escape the quotation marks of the data. There are three settings in PHP that can be implemented automatically for ' (single quotes), "(double quotes), \ \ (backslash), and NULL character transfer. PHP is called Magic quotes, these three settings are MAGIC_QUOTES_GPC affect the HTTP request data (Get,post and COOKIE) respectively. Cannot be changed at run time. The default value in PHP is on. Magic_quotes_runtime if open, most of the functions that get data from external sources and return the data, including from the database and text files, are escaped by backslashes. This option can be changed at run time, and the default value in PHP is off. Magic_quotes_sybase if turned on, single quotes are escaped using single quotes instead of backslashes. This option will completely overwrite the MAGIC_QUOTES_GPC. If you open two options at the same time, the single quotes will be escaped as ". Double quotes, backslashes, and NULL characters are not escaped. Although it is convenient to automatically escape the special symbols, this can reduce the efficiency of the program and cause the program portability to become cumbersome. Without knowing the server INI setting, you also need to call GET_MAGIC_QUOTES_GPC (), Get_magic_quotes_runtime (), or ini_get () to detect the status.
Special characters submitted by "PHP" will be automatically escaped