php教程之set_magic_quotes_runtime()函数的作用

星期二, 2011-01-04 | Author: Lee | disucz, pagemaker, php | 4,366 views

set_magic_quotes_runtime(0);

可以修改php.ini中 magic_quotes_runtime boolean的设置

当你的数据中有一些
\


这样的字符要写入到数据库里面,又想不被过滤掉的时候,它就很有用,会在这些字符前加上\

中国\我朝威武”朝拜”

中国\\朝威武\”朝拜\”

set_magic_quotes_runtime是用来设置PHP 环境配置的变量 magic_quotes_runtime 值。
0-关闭 1-打开

程序中检测状态用get_magic_quotes_runtime,返回 0 表示关闭本功能;返回 1 表示本功能打开。若 magic_quotes_runtime 打开时,所有外部引入的数据库资料或者文件等等都会自动转为含有反斜线溢出字符的资料。

Tags: ,

文章作者: Lee

本文地址: https://www.pomelolee.com/717.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

文章分类

Links

Meta