FILTER_VALIDATE_EMAIL, // This filter verifies that $_POST['sevendigits'] is // exactly a seven digit number using a regular expression. 'sevendigits' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array('regexp' => '/^\d{7}$/') ), // Make sure that $_POST['zerototwenty'] is a number // 0 to 20 using the min_range and max_range specs. 'zerototwenty' => array('filter' => FILTER_VALIDATE_INT, 'options' => array('min_range' => 0, 'max_range' => 20) ), // Encode the URL that's supposed to be encoded. 'encodeurl' => array( 'filter' => FILTER_SANITIZE_ENCODED ), // Verify that the incoming $_POST['checkboxes'] from // the checkbox list is actual an array like we expect. 'checkboxes' => array( 'filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_REQUIRE_ARRAY, ), // This field must be a boolean type. If mustbeboolean is // "true", "1", "TRUE" or some other value that represents // true then this will be true. Otherwise, it will be false. 'mustbeboolean' => array( 'filter' => FILTER_VALIDATE_BOOLEAN ), // Make sure that the hidden URL field is a valid // properly formatted URL. 'validurl' => FILTER_VALIDATE_URL, // This dosen't exist in the form, I'm just using it to show // what the result will be when an input dosen't exist. 'doesnotexist' => FILTER_VALIDATE_INT ); ?> PHP filter_input_array() Example
  
Email:

Seven Digits:

0 to 20:

Encode URL:

CB1:
CB2:
CB3:

Must be a Boolean: