Home  >  Article  >  Backend Development  >  How to turn off automatic escaping in php

How to turn off automatic escaping in php

藏色散人
藏色散人Original
2021-10-26 10:42:182416browse

php method to turn off automatic escaping: 1. Find and open the php.ini file; 2. Set "magic_quotes_gpc" and "magic_quotes_runtime" to "Off".

How to turn off automatic escaping in php

The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer

How to turn off automatic escaping in php?

php automatic escaping

There are two first selections in php.ini to control automatic escaping

  • magic_quotes_gpc: automatic escaping GET /POST/COOKIES

  • magic_quotes_runtime: Automatically escape SQL

I found the above problem when using json_decode today. It should be that the All double quotes are added with a slash "\"

By default, these two options are "On", set "Off" to turn them off. If you don't want to modify the configuration, you can use stripcslashes to convert the automatically escaped string. Anti-escape.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to turn off automatic escaping in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn