Q:

What is the Best Practice Handling PHP Encoding?

I have an html form that when users fill out, the information is processed and encoded into an email. The issue that keeps arising is when my company receives user emails the encoding turns colons, semi-colons, ampersands and commas into &#58;, &#59;, &amp; and &#44; which makes emails difficult to read.
As a newcomer to PHP and encoding i'm not sure which approach to take. Should I convert the email to an html format or should I remove the encoding all together? Could someone provide information/guidance on approaching this conflict?
Thank is advance!

A:

If I'm understanding you right the people filling out the form are putting in punctuation or chars that are being converted to asci.  To stop this use:
$yourvariable = htmlspecialchars($_POST['your input field'], ENT_QUOTES);

This should strip out most of the nasty stuff. 

