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

How to turn off automatic escaping in php

藏色散人
Release: 2023-03-13 13:54:02
Original
2486 people have browsed it

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template