get_magic_quotes_gpc

int get_magic_quotes_gpc(void) 

Gets the current magic_quotes_gpc setting.

Returns:

1 if on; 0 if off

Description:

Shows whether the configuration option magic_quotes_gpc is on or off. This can also be determined from phpinfo(). For example, this function is useful for determining whether addslashes() needs to be used on data before writing it to a database. magic_quotes_gpc controls whether data received from GET, POST, or COOKIE operations has special characters prepended with a backslash (\).

Version:

Existing since version 3.0.6

Example:

Check value of get_magic_quotes_gpc
if (get_magic_quotes_gpc()) echo "get_magic_quotes_gpc is on"; 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.