Home > Backend Development > PHP Tutorial > php自动转义

php自动转义

WBOY
Release: 2016-06-23 14:30:40
Original
1113 people have browsed it

php.ini中有两个先选控制自动转义

magic_quotes_gpc:自动转义GET/POST/COOKIES magic_quotes_runtime:自动转义SQL

今天在使用json_decode时发现上面的问题,应为将json中的所有双引号添加了斜线"\"

默认这两个选项为"On",设置"Off"将其关闭,如果不想修改配置,可以使用stripcslashes将自动转义的字符串再反转义回来。

 

参考

http://www.cnblogs.com/66feifei/archive/2008/05/06/1185408.html

http://hi.baidu.com/lovelyapple/blog/item/292133c7d58fd8cbd00060d3.html

Related labels:
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