07-18-2002, 06:16 AM
I am eading from a text area and then writing that content to a file. When I then read that file and display its contents, any single quote character appears with a backslash in front of it, e.g., "don't" appears as "don\'t".
Does anyone know why this happens and what steps can be taken to pevent it?
07-18-2002, 01:27 PM
it happens as PHP automatically escapes any special chars (this annoys many people) although magic_quotes can be disabled in the php.ini they rarely are (and partially for good reasons) but you can alter that with ini_set() at runtime if you wish www.php.net/ini_set
easiest way around is, when you display the data, instead of
07-18-2002, 05:29 PM
Thanks. I stripslashed $HTTP_POST_VARS and that got the job done.