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.
Read more at http://www.psychicperformer.com
Print “Magic Quotes gpc is turned on” ;
Print “Magic Quotes gpc is turned off” ;