PHP Functions to Mitigate against XSS and other Threats