function filter($text) { return htmlspecialchars(stripcslashes($text)); } $_GET = array_map('filter',$_GET); $_POST = array_map('filter',$_POST);