Skip to content

Instantly share code, notes, and snippets.

@eddy8
Created May 10, 2013 06:00
Show Gist options
  • Save eddy8/5552664 to your computer and use it in GitHub Desktop.
Save eddy8/5552664 to your computer and use it in GitHub Desktop.
PHP:html escape
<?php
function html_escape($var)
{
if (is_array($var))
{
return array_map('html_escape', $var);
}
else
{
return htmlspecialchars($var, ENT_QUOTES);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment