php validate integer

Can use

$validatedValue = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT);

See http://php.net/filter_input and related functions.

Leave a Comment