Home > Backend Development > PHP Tutorial > PHP get_magic_quotes_gpc 函数

PHP get_magic_quotes_gpc 函数

WBOY
Release: 2016-06-23 14:34:56
Original
1072 people have browsed it

get_magic_quotes_gpc

取得 PHP 环境变数 magic_quotes_gpc 的值。

语法: long get_magic_quotes_gpc(void);

传回值: 长整数。

函式种类: PHP 系统功能

 内容说明:

本函式取得 PHP 环境设定的变数 magic_quotes_gpc (GPC, Get/Post/Cookie) 值。传回 0 表示关闭本功能;传回 1 表示本功能开启。当 magic_quotes_gpc 开启时,所有的 ' (单引号), " (双引号), \ (反斜线) and 空字符会自动转为含有反斜线的溢出字符。

例:

function html($str)

{

     $str = get_magic_quotes_gpc()?$str:addslashes($str);

     return $str;

}

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