Public paste
Escape HTML
By: Guest | Date: Jan 30 2012 17:55 | Format: PHP | Expires: never | Size: 337 B | Hits: 502

  1. function escapeHTML($mix) {
  2.     if (!empty($mix)) {
  3.         if (is_array($mix)) {
  4.             foreach ($mix as $key => $value) {
  5.                 $mix[$key] = escapeHTML($value);
  6.             }
  7.             return $mix;
  8.         }
  9.         else return htmlentities($mix, ENT_QUOTES);
  10.     }
  11.     else {
  12.         return $mix;
  13.     }
  14. }