array('min_range' => 0)); $input = filter_var($input, FILTER_VALIDATE_INT, $int_options); } } else $input = strip_tags($input); $input = $dbobj->real_escape_string($input); } function post_clean($key, &$dbobj, $opts = null) { input_clean($_POST[$key], $dbobj, $opts); } function get_clean($key, &$dbobj, $intval = true) { if (array_key_exists($key, $_GET)) { $opts = ($intval) ? array('strip', 'nnegint') : null; input_clean($_GET[$key], $dbobj, $opts); } else { $_GET[$key] = ($intval) ? 0 : ''; } } ?>