views:

26

answers:

2

I have a PHP installation running 5.3.3 and when I use the code below:

    $sql = file('sql.txt');
    var_dump($sql);

All my single quotes are escaped. Why would this be happening. Magic quotes is enabled on the server (for some reason, it is out of my control) however I thought that magic quotes was only applied to GET POST COOKIE and REQUEST? I there something else I am missing here with the latest PHP?

Any ideas?

+2  A: 

magic_quotes_runtime causes this. Thankfully, this "feature" is off by default, but apparently it's enabled on your server.

Matthew Flaschen
A: 

From php.net:

If magic_quotes_runtime is enabled, most functions that return data from any sort of external source including databases and text files will have quotes escaped with a backslash.

galymzhan