Posted By

ginoplusio on 04/27/10


Tagged

get post strisplashesaddslashes


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

colingardom


Remove slashes from $_GET and $_POST arrays


 / Published in: PHP
 

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

  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. }

Report this snippet  

You need to login to post a comment.