PHP Validation

Confirm not an array

filter_input(INPUT_GET,'keywords',FILTER_DEFAULT,FILTER_REQUIRE_SCALAR);

Confirm an integer and set default value

$foo = filter_input(INPUT_GET, 'foo', FILTER_VALIDATE_INT, array('flags' => FILTER_REQUIRE_SCALAR, 'options' => array('default' => 23)));