Skip to content

Instantly share code, notes, and snippets.

@iforwms
Last active August 29, 2015 14:12
Show Gist options
  • Save iforwms/3fee5ad892d208a555bc to your computer and use it in GitHub Desktop.
Save iforwms/3fee5ad892d208a555bc to your computer and use it in GitHub Desktop.
PHP: Escape HTML
// ESCAPE HTML CHRACTERS WHEN OUTPUTTING DATA FROM DB
function html_escape($raw_input)
{
return htmlspecialchars($raw_input, ENT_QUOTES, 'UTF-8');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment