cancel
Showing results for 
Search instead for 
Did you mean: 

Removing \ in email text

digital
Grafter
Posts: 94
Registered: ‎11-04-2007

Removing \ in email text

I have a .php form which reads text inputs and then sends an email to me. If someone includes some thing like "I've" (without the quotes), it arrives as "I\'ve" (without the quotes).
Is there an easy way to correct this behaviour?
2 REPLIES 2
jojopillo
Grafter
Posts: 9,786
Registered: ‎16-06-2010

Re: Removing \ in email text

Best thing I could find was this. Hope that helps Smiley
digital
Grafter
Posts: 94
Registered: ‎11-04-2007

Re: Removing \ in email text

Hi Joanne,  thanks for the suggestion.
I found an alternative just five minutes ago:
replace mail($to, $subject, $message, $headers);
with
mail($to, $subject, stripslashes($message), $headers);
Seems to work fine.