Remove slashes from $_GET and $_POST arrays


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1.  
  2. function slashes($e) { if (is_array($e)) return array_map("slashes", $e); else return stripslashes($e); }
  3. if (isset ($_POST) && count($_POST)) $_POST = array_map("slashes", $_POST);
  4. if (isset ($_GET) && count($_GET)) $_GET = array_map("slashes", $_GET);
  5.  
  6. }

URL: http://www.barattalo.it/2010/04/27/always-remove-slashes-from-get-and-post/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.