PHP tries to shield programmers from the danger of special characters being used in user input by a process called magic quotes. PHP has a special php.ini setting called magic_quotes_gpc, which means that PHP will automatically place backslashes (\) before all quotes and other characters for GET, POST, and COOKIE data (GPC) the equivalent of running the addslashes( ) function.
The escape characters such as single quotes (') and double quotes (") are escaped with slashes (\). By default, any data that comes from GET, POST, and cookies operations is automatically escaped. When you send data that has special characters escaped to MySQL for insertion, MySQL automatically knows to convert the string back to the original values for storage in the database.
While magic quotes are good for beginners, they tend to create as many problems as they solve. Specifically, they waste some processing time, since all input is escaped regardless of whether it is bound for a database or may have been displayed. If you want to get the original text (without magic quotes) use stripslashes.