1. Home
  2. Computing & Technology
  3. PHP / MySQL

Get_magic_quotes_gpc PHP Function

By Angela Bradley, About.com

Definition: One way to check if Magic Quotes is running is to run get_magic_quotes_gpc(). It will return a 1 if it is on, or a 0 if it is off. You can use this result to print out the magic quotes status, or to decided if you should run another function, such as addslashes ().
Also Known As: Get Magic Quotes, Magic Quotes Status, Magic Quotes On, Magic Quotes Off
Examples:
<?php
if (get_magic_quotes_gpc()==1)
{
Print "Magic Quotes gpc is turned on" ;
}
else
{
Print "Magic Quotes gpc is turned off" ;
}
?>
This simple program would check if Magic Quotes was turned on or off.
Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. PHP Functions
  5. get_magic_quotes_gpc - Get Magic Quotes - Magic Quotes Off

©2009 About.com, a part of The New York Times Company.

All rights reserved.