Skip to content

Instantly share code, notes, and snippets.

@SemanticallyNull
Created November 9, 2012 15:14
Show Gist options
  • Save SemanticallyNull/4046241 to your computer and use it in GitHub Desktop.
Save SemanticallyNull/4046241 to your computer and use it in GitHub Desktop.
filter_var() example
<?php
$options = array('options'=>array(
'min_range' => 1,
'max_range' => 5,
'default' => 3
));
$_GET['grievous'] = filter_var($_GET['grievous'], FILTER_VALIDATE_INT, $options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment