I'm using PHP to write text from an HTML textarea to a text file. I'm getting backslashes in front of my apostraphes and quotes. How do I escape this? Several people have pointed me to the "stripslashes" function in the PHP manual, but being really new to PHP, I need an actual example of how to do it.
I'd be grateful for any help. Thanks.
$new_text = stripslashes($old_text);
Typical response....meaning nothing.
Is this better?
If you want to write in a file a text which has been write in a textarea form, you have to use this function.
fputs($temp,stripslashes($texte));
this will remove the Magic Slashes -> \" will become " 🙂
Worked like a charm. Thank you.