you're writing to a textfile, right? I guess i'm not too sure what you're going to be doing with this textfile, but if you're going to be using php to read it and display it, when you open the fiel for reading and area bout to display it, use the stripslashes() function
echo stripslashes($file_text_var);
where $file_text_var contains the text in your textfile. I'm pretty sure you get a parse error if those characters aren't escaped, but if you're running php off your computer (not a remote host), then you can set magic quotes to off in your php.ini. If you are using a pay host (or any host other than yourself), then you'll have to work with the settings they provide. stripslashes() will strip the slashes from the file. I personally would leave the slashes in the textfile, and only strip them when I was about to display the info. Depends what the texfile is being used for I guess. If you have employees downloading the text file through ftp, you don't want the slashes there, however if you're displaying the contents of the text file through a browser, stripslashes() will do the trick.
Cgraz