I was asking about the way to properly maintain characters from appearing in ASCII once the email is dispatched from the PHP email script.
For example, if an email is sent with the following subject:
This is a 'SUBJECT' but "what" is the <encoding>?
It arrives as:
This is a \'SUBJECT\' but \"what\" is the ?
The variable the subject is being retrieved from is echo stripslashes($_POST['subject'])
I was told I could use htmlentities
but I'm getting nothing but errors. I'm also trying to use stripslashes
along with it.
What is the proper setting for htmlentities
to respect everything as it is instead of trying to break it down into ASCII
?
I've tried a few different ones but most returned errors or didn't do what was desired.
echo htmlentities(stripslashes($_POST['subject'], ENT_COMPAT | ENT_HTML401, "UTF-8"))
Can anyone tell me what I'm doing wrong? I'm not sure if I'm using the proper parameters or syntax. http://php.net/manual/en/function.htmlentities.php
htmlentities
to which they belong? – mario Mar 13 '13 at 3:11magic_quotes
. Or use one of the workarounds from the manual to apply stripslashes centrally. – mario Mar 13 '13 at 3:13